Find the best Rector rule to solve your problem


Configurable

RenameAnnotationRector

Turns defined annotations above properties and methods to their new values.

 use PHPUnit\Framework\TestCase;

 final class SomeTest extends TestCase
 {
     /**
-     * @test
+     * @scenario
      */
     public function someMethod()
     {
     }
 }

RemoveDataProviderTestPrefixRector

Data provider methods cannot start with "test" prefix

 class SomeClass extends PHPUnit\Framework\TestCase
 {
     /**
-     * @dataProvider testProvideData()
+     * @dataProvider provideData()
      */
     public function test()
     {
         $nothing = 5;
     }

-    public function testProvideData()
+    public function provideData()
     {
         return ['123'];
     }
 }