| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function testRead() |
||
| 21 | { |
||
| 22 | $content = <<<CSV |
||
| 23 | id,name |
||
| 24 | 1,John |
||
| 25 | 2,Peter |
||
| 26 | CSV; |
||
| 27 | vfsStream::newFile('test.csv')->setContent($content)->at($this->root); |
||
| 28 | $csv = new Csv(vfsStream::url('root/test.csv')); |
||
| 29 | $this->assertSame([ |
||
| 30 | 'id' => '1', |
||
| 31 | 'name' => 'John', |
||
| 32 | ], $csv->get()); |
||
| 33 | $this->assertSame([ |
||
| 34 | 'id' => '2', |
||
| 35 | 'name' => 'Peter', |
||
| 36 | ], $csv->get()); |
||
| 37 | $this->assertSame(false, $csv->get()); |
||
| 38 | } |
||
| 39 | |||
| 102 |