| @@ 33-39 (lines=7) @@ | ||
| 30 | * @test |
|
| 31 | * @covers ::isHeaderRow |
|
| 32 | */ |
|
| 33 | public function rowIsHeaderRow() |
|
| 34 | { |
|
| 35 | $strategy = new DeriveHeaderStrategy(); |
|
| 36 | $fileObject = $this->getFileObject(); |
|
| 37 | $headers = $strategy->getHeaders($fileObject); |
|
| 38 | $this->assertTrue($strategy->isHeaderRow($fileObject->fgetcsv())); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @test |
|
| @@ 45-52 (lines=8) @@ | ||
| 42 | * @test |
|
| 43 | * @covers ::isHeaderRow |
|
| 44 | */ |
|
| 45 | public function rowNotIsHeaderRow() |
|
| 46 | { |
|
| 47 | $strategy = new DeriveHeaderStrategy(); |
|
| 48 | $fileObject = $this->getFileObject(); |
|
| 49 | $headers = $strategy->getHeaders($fileObject); |
|
| 50 | $fileObject->fgetcsv(); |
|
| 51 | $this->assertFalse($strategy->isHeaderRow($fileObject->fgetcsv())); |
|
| 52 | } |
|
| 53 | ||
| 54 | private function getFileObject() : SplFileObject |
|
| 55 | { |
|