rectorphp / rector-phpunit

Rector upgrade rules for PHPUnit
https://getrector.com/find-rule?activeRectorSetGroup=phpunit
MIT License
68 stars 47 forks source link

[PHPUnit 10] Add AnnotationWithValueToAttributeRector #129

Closed TomasVotruba closed 1 year ago

TomasVotruba commented 1 year ago

Before

use PHPUnit\Framework\TestCase;

final class WithADataProvider extends TestCase
{
    /**
     * @dataProvider provideData()
     */
    public function test()
    {

    }
}

After

use PHPUnit\Framework\TestCase;

final class WithADataProvider extends TestCase
{
    #[\PHPUnit\Framework\Attributes\DataProvider('provideData()')]
    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: