mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-24 01:14:14 +02:00
[PHPUnit] make ArrayToYieldDataProviderRector cover 'dataProvider' name as well
This commit is contained in:
parent
4603e0b655
commit
f680e197ac
src/Rector/Architecture/PHPUnit
tests/Rector/Architecture/PHPUnit
@ -119,7 +119,11 @@ CODE_SAMPLE
|
||||
|
||||
private function isInProvideMethod(ClassMethod $classMethodNode): bool
|
||||
{
|
||||
return (bool) Strings::match($classMethodNode->name, '#^provide*#');
|
||||
if (! $classMethodNode->isPublic()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool) Strings::match($classMethodNode->name, '#^(provide|dataProvider)*#');
|
||||
}
|
||||
|
||||
private function hasClassMethodReturnArrayOfArrays(ClassMethod $classMethodNode): bool
|
||||
|
@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class MyTestCase extends TestCase
|
||||
{
|
||||
public function provideWrongToFixedFiles(): \Iterator
|
||||
public function dataProvider(): \Iterator
|
||||
{
|
||||
yield [__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc'];
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class MyTestCase extends TestCase
|
||||
{
|
||||
public function provideWrongToFixedFiles(): array
|
||||
public function dataProvider(): array
|
||||
{
|
||||
return [[__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc']];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user