Remove "setMethods()" method as never used, move methods to "addMethods()" if non-existent or @method magic
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
public function test()
{
$someMock = $this->getMockBuilder(SomeClass::class)
- ->setMethods(['run'])
->getMock();
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit100\Rector\MethodCall\RemoveSetMethodsMethodCallRector;
return RectorConfig::configure()
->withRules([
RemoveSetMethodsMethodCallRector::class,
]);