Remove standalone method calls with no effect
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
public function test()
{
- $this->createMock('SomeClass');
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\RemoveStandaloneCreateMockRector;
return RectorConfig::configure()
->withRules([
RemoveStandaloneCreateMockRector::class,
]);