Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function theCsvFileShouldContainElements(string $path, int $number): void |
||
25 | { |
||
26 | $file = new SplFileObject($this->projectDir.$path, 'r'); |
||
27 | |||
28 | $file->seek(PHP_INT_MAX); |
||
29 | $elements = $file->key() + 1; |
||
30 | |||
31 | if ($elements !== $number) { |
||
32 | throw new \Exception("The file contains $elements rows but expected $number!"); |
||
33 | } |
||
34 | } |
||
35 | } |
||
36 |