From 633aad5203d7001ae1323a432129a79e91560cf4 Mon Sep 17 00:00:00 2001 From: Ignace Nyamagana Butera Date: Fri, 5 Jun 2015 12:51:37 +0200 Subject: [PATCH] Improve Conversion method --- src/AbstractCsv.php | 2 +- test/CsvTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AbstractCsv.php b/src/AbstractCsv.php index 72b1959f..14dcf3ca 100644 --- a/src/AbstractCsv.php +++ b/src/AbstractCsv.php @@ -163,7 +163,7 @@ protected function getConversionIterator() $iterator->setFlags($this->flags|SplFileObject::READ_AHEAD|SplFileObject::SKIP_EMPTY); $iterator = $this->applyBomStripping($iterator); $iterator = new CallbackFilterIterator($iterator, function ($row) { - return is_array($row); + return is_array($row) && [null] != $row; }); $iterator = $this->applyIteratorFilter($iterator); $iterator = $this->applyIteratorSortBy($iterator); diff --git a/test/CsvTest.php b/test/CsvTest.php index 68f0ba83..5cd2837f 100644 --- a/test/CsvTest.php +++ b/test/CsvTest.php @@ -54,7 +54,7 @@ public function testToXML() public function testJsonSerialize() { - $this->assertContains(['john', 'doe', 'john.doe@example.com'], json_decode(json_encode($this->csv), true)); + $this->assertSame($this->expected, json_decode(json_encode($this->csv), true)); } /**