Remove getMockBuilder() to createMock()
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
public function test()
{
- $applicationMock = $this->getMockBuilder('SomeClass')
- ->disableOriginalConstructor()
- ->getMock();
+ $applicationMock = $this->createMock('SomeClass');
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit60\Rector\MethodCall\GetMockBuilderGetMockToCreateMockRector;
return RectorConfig::configure()
->withRules([
GetMockBuilderGetMockToCreateMockRector::class,
]);