Change deprecated $this->any() matcher assign to direct new AnyInvokedCount()
+use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
public function test(): void
{
- $matcher = $this->any();
+ $matcher = new AnyInvokedCount();
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit120\Rector\Assign\AnyMatcherToNewAnyInvokedCountRector;
return RectorConfig::configure()
->withRules([
AnyMatcherToNewAnyInvokedCountRector::class,
]);