File tree Expand file tree Collapse file tree 11 files changed +35
-35
lines changed
rules-tests/CodeQuality/Rector/MethodCall
MatchAssertEqualsExpectedTypeRector
MatchAssertSameExpectedTypeRector/config
rules/CodeQuality/Rector/MethodCall Expand file tree Collapse file tree 11 files changed +35
-35
lines changed Original file line number Diff line number Diff line change 3131use Rector \PHPUnit \CodeQuality \Rector \MethodCall \AssertSameTrueFalseToAssertTrueFalseRector ;
3232use Rector \PHPUnit \CodeQuality \Rector \MethodCall \AssertTrueFalseToSpecificMethodRector ;
3333use Rector \PHPUnit \CodeQuality \Rector \MethodCall \FlipAssertRector ;
34- use Rector \PHPUnit \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector ;
34+ use Rector \PHPUnit \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector ;
3535use Rector \PHPUnit \CodeQuality \Rector \MethodCall \NarrowIdenticalWithConsecutiveRector ;
3636use Rector \PHPUnit \CodeQuality \Rector \MethodCall \NarrowSingleWillReturnCallbackRector ;
3737use Rector \PHPUnit \CodeQuality \Rector \MethodCall \RemoveExpectAnyFromMockRector ;
4646 ConstructClassMethodToSetUpTestCaseRector::class,
4747
4848 AssertSameTrueFalseToAssertTrueFalseRector::class,
49- MatchAssertSameExpectedTypeRector ::class,
49+ MatchAssertEqualsExpectedTypeRector ::class,
5050
5151 AssertEqualsToSameRector::class,
5252 PreferPHPUnitThisCallRector::class,
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
3+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
44
55use PHPUnit \Framework \TestCase ;
66
77final class MatchAssertType extends TestCase
88{
99 public function test ()
1010 {
11- $ this ->assertSame ('123 ' , $ this ->getOrderId ());
11+ $ this ->assertEquals ('123 ' , $ this ->getOrderId ());
1212 }
1313
1414 private function getOrderId (): int
@@ -21,15 +21,15 @@ final class MatchAssertType extends TestCase
2121-----
2222<?php
2323
24- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
24+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
2525
2626use PHPUnit \Framework \TestCase ;
2727
2828final class MatchAssertType extends TestCase
2929{
3030 public function test ()
3131 {
32- $ this ->assertSame (123 , $ this ->getOrderId ());
32+ $ this ->assertEquals (123 , $ this ->getOrderId ());
3333 }
3434
3535 private function getOrderId (): int
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
3+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
44
55use PHPUnit \Framework \TestCase ;
66
77final class MatchIntegerToString extends TestCase
88{
99 public function test ()
1010 {
11- $ this ->assertSame (123 , $ this ->getOrderId ());
11+ $ this ->assertEquals (123 , $ this ->getOrderId ());
1212 }
1313
1414 private function getOrderId (): string
@@ -21,15 +21,15 @@ final class MatchIntegerToString extends TestCase
2121-----
2222<?php
2323
24- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
24+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
2525
2626use PHPUnit \Framework \TestCase ;
2727
2828final class MatchIntegerToString extends TestCase
2929{
3030 public function test ()
3131 {
32- $ this ->assertSame ('123 ' , $ this ->getOrderId ());
32+ $ this ->assertEquals ('123 ' , $ this ->getOrderId ());
3333 }
3434
3535 private function getOrderId (): string
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
3+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
44
55use PHPUnit \Framework \TestCase ;
66
77final class NullableMatchAssertType extends TestCase
88{
99 public function test ()
1010 {
11- $ this ->assertSame ('123 ' , $ this ->getOrderId ());
11+ $ this ->assertEquals ('123 ' , $ this ->getOrderId ());
1212 }
1313
1414 private function getOrderId (): ?int
@@ -21,15 +21,15 @@ final class NullableMatchAssertType extends TestCase
2121-----
2222<?php
2323
24- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
24+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
2525
2626use PHPUnit \Framework \TestCase ;
2727
2828final class NullableMatchAssertType extends TestCase
2929{
3030 public function test ()
3131 {
32- $ this ->assertSame (123 , $ this ->getOrderId ());
32+ $ this ->assertEquals (123 , $ this ->getOrderId ());
3333 }
3434
3535 private function getOrderId (): ?int
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
3+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
44
55use PHPUnit \Framework \TestCase ;
66
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
3+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
44
55use PHPUnit \Framework \TestCase ;
66
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector \Fixture ;
3+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector \Fixture ;
44
55use PHPUnit \Framework \TestCase ;
66
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertSameExpectedTypeRector ;
5+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \MatchAssertEqualsExpectedTypeRector ;
66
77use Iterator ;
88use PHPUnit \Framework \Attributes \DataProvider ;
99use Rector \Testing \PHPUnit \AbstractRectorTestCase ;
1010
11- final class MatchAssertSameExpectedTypeRectorTest extends AbstractRectorTestCase
11+ final class MatchAssertEqualsExpectedTypeRectorTest extends AbstractRectorTestCase
1212{
1313 #[DataProvider('provideData ' )]
1414 public function test (string $ filePath ): void
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 \MatchAssertEqualsExpectedTypeRector ;
7+
8+ return static function (RectorConfig $ rectorConfig ): void {
9+ $ rectorConfig ->rule (MatchAssertEqualsExpectedTypeRector::class);
10+ };
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments