Replace @test with prefixed function
class SomeTest extends \PHPUnit\Framework\TestCase
{
- /**
- * @test
- */
- public function onePlusOneShouldBeTwo()
+ public function testOnePlusOneShouldBeTwo()
{
$this->assertSame(2, 1+1);
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\ReplaceTestAnnotationWithPrefixedFunctionRector;
return RectorConfig::configure()
->withRules([
ReplaceTestAnnotationWithPrefixedFunctionRector::class,
]);