Change data provider in PHPUnit test case to newline per item
use PHPUnit\Framework\TestCase;
final class ImageBinaryTest extends TestCase
{
/**
* @dataProvider provideData()
*/
public function testGetBytesSize(string $content, int $number): void
{
// ...
}
public static function provideData(): array
{
- return [['content', 8], ['content123', 11]];
+ return [
+ ['content', 8],
+ ['content123', 11]
+ ];
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\ClassMethod\DataProviderArrayItemsNewLinedRector;
return RectorConfig::configure()
->withRules([
DataProviderArrayItemsNewLinedRector::class,
]);