rectorphp / rector-phpunit

Rector upgrade rules for PHPUnit
http://getrector.com
MIT License
62 stars 47 forks source link

[PHPUnit 10] Add CoversAnnotationWithValueToAttributeRector #131

Closed TomasVotruba closed 1 year ago

TomasVotruba commented 1 year ago
 use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Attributes\CoversClass;
+use PHPUnit\Framework\Attributes\CoversFunction;

-/**
- * @covers SomeClass
- */
+#[CoversClass(SomeClass::class)]
 final class SomeTest extends TestCase
 {
-    /**
-     * @covers ::someFunction
-     */
+    #[CoversFunction('someFunction')]
     public function test()
     {
     }
 }
TomasVotruba commented 1 year ago

@sebastianbergmann Hi Sebastian, I've extended PHPUnit annotation to attribute set with the few edge cases, so we're ready when PHPUnit 10 is out :+1: