Skip to content

Commit 9048389

Browse files
committed
test(tests): Add test for rule class name consistency
- Verify that the test class name matches the expected pattern based on the rule class name - Ensures proper naming conventions and class association in test suite
1 parent f439499 commit 9048389

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"ergebnis/rector-rules": "^1.9",
5151
"fakerphp/faker": "^1.24",
5252
"guanguans/php-cs-fixer-custom-fixers": "^1.1",
53-
"guanguans/rector-rules": "^1.3",
53+
"guanguans/rector-rules": "^1.4",
5454
"mockery/mockery": "^1.6",
5555
"nette/utils": "^3.2 || ^4.0",
5656
"pestphp/pest": "^1.23 || ^2.0 || ^3.0 || ^4.0",

tests/Rule/AbstractRuleTestCase.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ final public function testRuleBasicInformation(): void
6969
));
7070
}
7171

72+
final public function testRuleTestCaseClassName(): void
73+
{
74+
self::assertSame(
75+
static::class,
76+
(string) Str::of(static::ruleClass())
77+
->replace('PHPStanRules', 'PHPStanRulesTests')
78+
->append('\\', static::ruleReflectionClass()->getShortName(), 'Test')
79+
);
80+
}
81+
7282
/**
7383
* @return list<string>
7484
*/

0 commit comments

Comments
 (0)