-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…oviderRector (#415) * YieldDataProviderRector: added failling test * Update use_data_provider_with_phpdoc.php.inc * Update rules-tests/CodeQuality/Rector/Class_/YieldDataProviderRector/Fixture/use_data_provider_with_phpdoc.php.inc Co-authored-by: Abdul Malik Ikhsan <[email protected]> * Closes #414 --------- Co-authored-by: Markus Staab <[email protected]> Co-authored-by: Markus Staab <[email protected]>
- Loading branch information
1 parent
2c63591
commit b650d6e
Showing
2 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
...ality/Rector/Class_/YieldDataProviderRector/Fixture/use_data_provider_with_phpdoc.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\YieldDataProviderRector\Fixture; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
final class UseDataProviderTestPhpdoc extends TestCase | ||
{ | ||
#[\PHPUnit\Framework\Attributes\DataProvider('dataProvider')] | ||
#[\PHPUnit\Framework\Attributes\DataProvider('provideDataForProvider')] | ||
public function test(string $filePath): void | ||
{ | ||
} | ||
|
||
/** @return array<int, array<string>> */ | ||
public static function provideDataForProvider() | ||
{ | ||
return [ | ||
['<?php implode("", $foo, );', '<?php implode($foo, "", );'] | ||
]; | ||
} | ||
|
||
public static function dataProvider() | ||
{ | ||
return [ | ||
['<?php implode(\'\', $foo, );', '<?php implode($foo, );'], | ||
['<?php implode(\'\', $foo, );', '<?php implode($foo, );'] | ||
]; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\YieldDataProviderRector\Fixture; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
final class UseDataProviderTestPhpdoc extends TestCase | ||
{ | ||
#[\PHPUnit\Framework\Attributes\DataProvider('dataProvider')] | ||
#[\PHPUnit\Framework\Attributes\DataProvider('provideDataForProvider')] | ||
public function test(string $filePath): void | ||
{ | ||
} | ||
|
||
/** @return \Iterator<int, array<string>> */ | ||
public static function provideDataForProvider(): \Iterator | ||
{ | ||
yield ['<?php implode("", $foo, );', '<?php implode($foo, "", );']; | ||
} | ||
|
||
public static function dataProvider(): \Iterator | ||
{ | ||
yield ['<?php implode(\'\', $foo, );', '<?php implode($foo, );']; | ||
yield ['<?php implode(\'\', $foo, );', '<?php implode($foo, );']; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters