I've added config/set/phpunit/phpunit-yield-data-provider.yaml to my imports, which does the following :
services:
Rector\CodingStyle\Rector\ClassMethod\ReturnArrayClassMethodToYieldRector:
PHPUnit\Framework\TestCase:
- '#(provide|dataProvider)*#'
I would have assumed that this would apply only on methods targeted by a dataProvider, but it's not. I had a private function getSomeData(): array; method in a test that got changed by the Rector (furthermore, data providers in PHPUnit are always public!).
Is there something I misunderstood about the intended behavior of this config file ? Or should I try to add a broken test ?
I've added
config/set/phpunit/phpunit-yield-data-provider.yamlto myimports, which does the following :I would have assumed that this would apply only on methods targeted by a dataProvider, but it's not. I had a
private function getSomeData(): array;method in a test that got changed by the Rector (furthermore, data providers in PHPUnit are alwayspublic!).Is there something I misunderstood about the intended behavior of this config file ? Or should I try to add a broken test ?