Add "@group
" docblock annotation to classes inheriting from or implementing given targetClass or interface
🔧 configure it!
use Basster\Rector\PhpUnit\Rector\Class_\PhpUnitTestToGroupRector;
use Basster\Rector\PhpUnit\ValueObject\PhpUnitTestToGroup;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(
PhpUnitTestToGroupRector::class,
[new PhpUnitTestToGroup('slow', '\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase')]
);
};
↓
+/**
+ * @group slow
+ */
class SomeKernelTest extends \Symfony\Bundle\FrameworkBundle\Test\KernelTestCase
{
}
use Basster\Rector\PhpUnit\Rector\Class_\PhpUnitTestToGroupRector;
use Basster\Rector\PhpUnit\ValueObject\PhpUnitTestToGroup;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(
PhpUnitTestToGroupRector::class,
[new PhpUnitTestToGroup('slow', '\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase')]
);
};
↓
+/**
+ * @group slow
+ */
class SomeKernelTest extends \Symfony\Bundle\FrameworkBundle\Test\WebTestCase
{
// \Symfony\Bundle\FrameworkBundle\Test\WebTestCase inherits from '\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase'
}