Changes PHPUnit calls from self::assert*() to $this->assert*()
use PHPUnit\Framework\TestCase;
final class SomeClass extends TestCase
{
public function run()
{
- self::assertEquals('expected', $result);
+ $this->assertEquals('expected', $result);
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
return RectorConfig::configure()
->withRules([
PreferPHPUnitThisCallRector::class,
]);