|
31 | 31 | // https://github.com/sebastianbergmann/phpunit/issues/4087 |
32 | 32 | new MethodCallRename('PHPUnit\Framework\Assert', 'assertRegExp', 'assertMatchesRegularExpression'), |
33 | 33 |
|
34 | | - // https://github.com/sebastianbergmann/phpunit/issues/5220 |
35 | | - new MethodCallRename('PHPUnit\Framework\Assert', 'assertObjectHasAttribute', 'assertObjectHasProperty'), |
36 | | - new MethodCallRename('PHPUnit\Framework\Assert', 'assertObjectNotHasAttribute', 'assertObjectNotHasProperty'), |
37 | | - |
38 | | - new MethodCallRename( |
39 | | - 'PHPUnit\Framework\MockObject\Rule\InvocationOrder', |
40 | | - 'getInvocationCount', |
41 | | - 'numberOfInvocations' |
42 | | - ), |
43 | | - |
44 | 34 | // https://github.com/sebastianbergmann/phpunit/issues/4090 |
45 | 35 | new MethodCallRename('PHPUnit\Framework\Assert', 'assertNotRegExp', 'assertDoesNotMatchRegularExpression'), |
46 | 36 |
|
|
102 | 92 | 'expectExceptionMessageMatches' |
103 | 93 | ), |
104 | 94 | ]); |
| 95 | + |
| 96 | + // the numberOfInvocations() method was added in PHPUnit 10.0 |
| 97 | + // @see https://github.com/sebastianbergmann/phpunit/commit/2ba8b7fded44a1a75cf5712a3b7310a8de0b6bb8 |
| 98 | + $rectorConfig->ruleWithConfigurationComposerVersionBound(RenameMethodRector::class, [ |
| 99 | + new MethodCallRename( |
| 100 | + 'PHPUnit\Framework\MockObject\Rule\InvocationOrder', |
| 101 | + 'getInvocationCount', |
| 102 | + 'numberOfInvocations' |
| 103 | + ), |
| 104 | + ], 'phpunit/phpunit', '>=10.0'); |
| 105 | + |
| 106 | + // the assertObjectHasProperty() and assertObjectNotHasProperty() methods were added in PHPUnit 10.1 |
| 107 | + // @see https://github.com/sebastianbergmann/phpunit/issues/5220 |
| 108 | + $rectorConfig->ruleWithConfigurationComposerVersionBound(RenameMethodRector::class, [ |
| 109 | + new MethodCallRename('PHPUnit\Framework\Assert', 'assertObjectHasAttribute', 'assertObjectHasProperty'), |
| 110 | + new MethodCallRename('PHPUnit\Framework\Assert', 'assertObjectNotHasAttribute', 'assertObjectNotHasProperty'), |
| 111 | + ], 'phpunit/phpunit', '>=10.1'); |
105 | 112 | }; |
0 commit comments