File tree Expand file tree Collapse file tree 3 files changed +62
-0
lines changed
tests/Issues/AssertEqualsSame Expand file tree Collapse file tree 3 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \PHPUnit \Tests \Issues \AssertEqualsSame ;
6+
7+ use Iterator ;
8+ use PHPUnit \Framework \Attributes \DataProvider ;
9+ use Rector \Testing \PHPUnit \AbstractRectorTestCase ;
10+
11+ final class AssertEqualsSameTest extends AbstractRectorTestCase
12+ {
13+ #[DataProvider('provideData ' )]
14+ public function test (string $ filePath ): void
15+ {
16+ $ this ->doTestFile ($ filePath );
17+ }
18+
19+ public static function provideData (): Iterator
20+ {
21+ return self ::yieldFilesFromDirectory (__DIR__ . '/Fixture ' );
22+ }
23+
24+ public function provideConfigFilePath (): string
25+ {
26+ return __DIR__ . '/config/configured_rule.php ' ;
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \PHPUnit \Tests \Issues \AssertEqualsSame ;
6+
7+ use PHPUnit \Framework \TestCase ;
8+
9+ class SkipAssertEquals extends TestCase
10+ {
11+ public function test ()
12+ {
13+ $ this ->assertEquals (123 , $ this ->getOrderId ());
14+ }
15+
16+ private function getOrderId (): string
17+ {
18+ return '0000000000000000000123 ' ;
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Rector \Config \RectorConfig ;
6+ use Rector \PHPUnit \CodeQuality \Rector \MethodCall \AssertEqualsToSameRector ;
7+ use Rector \PHPUnit \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector ;
8+
9+ return static function (RectorConfig $ rectorConfig ): void {
10+ $ rectorConfig ->rules ([
11+ MatchAssertSameExpectedTypeRector::class,
12+ AssertEqualsToSameRector::class,
13+ ]);
14+ };
You can’t perform that action at this time.
0 commit comments