Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 1.52 KB

rector_rules_overview.md

File metadata and controls

62 lines (48 loc) · 1.52 KB

1 Rules Overview

PhpUnitTestToGroupRector

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'
 }