Tests without assertion will have #[DoesNotPerformAssertions] attribute, or @doesNotPerformAssertions annotation on PHPUnit below 10
use PHPUnit\Framework\TestCase;
class SomeClass extends TestCase
{
+ #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
public function test()
{
$nothing = 5;
}
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector;
return RectorConfig::configure()
->withRules([
AddDoesNotPerformAssertionToNonAssertingTestRector::class,
]);