| Total Complexity | 2 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | final class NsArrayPrinterTest extends TestCase |
||
|
|
|||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @param array $testedArray |
||
| 25 | * @param PhpNamespace $namespace |
||
| 26 | * @param string $expected |
||
| 27 | * |
||
| 28 | * @dataProvider arrayProvider |
||
| 29 | */ |
||
| 30 | public function testPrintArray(array $testedArray, PhpNamespace $namespace, string $expected): void |
||
| 31 | { |
||
| 32 | $printer = new NsArrayPrinter($namespace); |
||
| 33 | $this->assertSame($expected, $printer->printArray($testedArray)); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function arrayProvider(): array |
||
| 101 | [ |
||
| 102 | {id:\d+}, |
||
| 111 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.