Change data provider methods to public
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
/**
* @dataProvider provideData()
*/
public function test()
{
}
- protected static function provideData()
+ public static function provideData()
{
yield [1];
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit100\Rector\Class_\PublicDataProviderClassMethodRector;
return RectorConfig::configure()
->withRules([
PublicDataProviderClassMethodRector::class,
]);