Skip to content

Commit 4047026

Browse files
committed
YieldDataProviderRector: Added failling test
1 parent eb751d4 commit 4047026

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\YieldDataProviderRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
final class UseDataProviderTest extends TestCase
8+
{
9+
#[\PHPUnit\Framework\Attributes\DataProvider('dataProvider')]
10+
public function test(string $val1, string $val2): void
11+
{
12+
}
13+
14+
public static function dataProvider(): iterable
15+
{
16+
yield from [
17+
['value3', 'value4'],
18+
['value5', 'value6'],
19+
['value7', 'value8'],
20+
];
21+
22+
if (PHP_VERSION_ID < 80100) {
23+
return;
24+
}
25+
26+
return [['value1', 'value2']];
27+
}
28+
29+
}
30+
31+
?>

0 commit comments

Comments
 (0)