Skip to content

Commit

Permalink
merge conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jan 13, 2014
2 parents 1c449f3 + 25b264e commit 43591db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ $data = $csv->fetchAssoc(['firstname', 'lastname', 'email'], function ($value) {
//
```



#### `Reader::fetchCol`

This method returns an sequentials array for a given CSV column.
Expand Down
3 changes: 3 additions & 0 deletions test/Bakame/Csv/ReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ public function testFetchAssoc()
}

$keys = ['firstname'];

$res = $this->csv->fetchAssoc($keys);
$this->assertSame([['firstname' => 'john'], ['firstname' => 'jane']], $res);

$keys = ['firstname', 'lastname', 'email', 'age'];
$res = $this->csv->fetchAssoc($keys);

foreach ($res as $index => $row) {
$this->assertCount(4, array_values($row));
$this->assertNull($row['age']);
}

$this->csv->fetchAssoc([['firstname', 'lastname', 'email', 'age']]);
}

Expand Down

0 comments on commit 43591db

Please sign in to comment.