Closed staabm closed 2 months ago
after this PR it now correctly yields:
4) tests/unit/Metadata/Parser/AttributeParserTestCase.php:52
---------- begin diff ----------
@@ @@
use PHPUnit\TestFixture\Metadata\Attribute\UsesTest;
use PHPUnit\TestFixture\Metadata\Attribute\WithoutErrorHandlerTest;
+#[\PHPUnit\Framework\Attributes\CoversClass(\PHPUnit\Metadata\Parser\AttributeParser::class)]
abstract class AttributeParserTestCase extends TestCase
{
#[TestDox('Parses #[BackupGlobals] attribute on class')]
----------- end diff -----------
Applied rules:
* AddCoversClassAttributeRector
5) tests/unit/TextUI/Configuration/Xml/MigratorTest.php:12
---------- begin diff ----------
@@ @@
use PHPUnit\Framework\TestCase;
use PHPUnit\Util\Xml\Loader as XmlLoader;
+#[\PHPUnit\Framework\Attributes\CoversClass(\PHPUnit\TextUI\XmlConfiguration\Migrator::class)]
final class MigratorTest extends TestCase
{
#[TestDox('Can migrate PHPUnit 9.2 configuration')]
----------- end diff -----------
Applied rules:
* AddCoversClassAttributeRector
Thank you @staabm
In some projects (e.g. PHPUnit itself) testcase-names are ending in
TestCase
not justTest
running the new rector on phpunit itself yields a few false positives, e.g.
refs https://github.com/rectorphp/rector-phpunit/pull/319#issuecomment-2053952839