Change the array-index names to the argument name of the dataProvider
use PHPUnit\Framework\TestCase;
final class SomeTest extends TestCase
{
public static function dataProviderArray(): array
{
return [
[
- 'keyA' => true,
- 'keyB' => false,
+ 'changeToKeyA' => true,
+ 'changeToKeyB' => false,
]
];
}
#[\PHPUnit\Framework\Attributes\DataProvider('dataProviderArray')]
public function testFilter(bool $changeToKeyA, bool $changeToKeyB): void
{
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit110\Rector\Class_\NamedArgumentForDataProviderRector;
return RectorConfig::configure()
->withRules([
NamedArgumentForDataProviderRector::class,
]);