Tests without assertion will have @doesNotPerformAssertion
use PHPUnit\Framework\TestCase;
class SomeClass extends TestCase
{
+ /**
+ * @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,
]);