| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | protected function compareOutputs(array $expected, array $actual) |
||
| 29 | { |
||
| 30 | $this->assertSameSize($expected, $actual); |
||
| 31 | |||
| 32 | for ($i = 0; $i < count($expected); $i++) { |
||
|
|
|||
| 33 | $this->assertSameSize($expected[$i], $actual[$i]); |
||
| 34 | for ($j = 0; $j < count($expected[$i]); $j++) { |
||
| 35 | $this->assertRegExp($expected[$i][$j], $actual[$i][$j], sprintf('group: %d, line: %d', $i + 1, $j + 1)); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: