Change single-value withConsecutive() to with() call, willReturnOnConsecutiveCalls() to willReturn() call
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
public function run()
{
$this->personServiceMock->expects($this->exactly(3))
->method('prepare')
- ->withConsecutive(
- [1],
- );
+ ->with([1]);
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\MethodCall\SingleWithConsecutiveToWithRector;
return RectorConfig::configure()
->withRules([
SingleWithConsecutiveToWithRector::class,
]);