Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #15 from box/add_test_for_skipping_empty_rows
Browse files Browse the repository at this point in the history
Add test for skipping empty rows
  • Loading branch information
adrilo committed Apr 4, 2015
2 parents 66e5792 + 93cdd39 commit 538f610
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Spout/Writer/CSVTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ public function testWriteShouldSupportNullValues()
$this->assertEquals('csv--11,,csv--13', $writtenContent, 'The null values should be replaced by empty values');
}

/**
* @return void
*/
public function testWriteShouldSkipEmptyRows()
{
$allRows = [
['csv--11', 'csv--12'],
[],
['csv--31', 'csv--32'],
];
$writtenContent = $this->writeToCsvFileAndReturnWrittenContent($allRows, 'csv_with_empty_rows.csv');
$writtenContent = $this->trimWrittenContent($writtenContent);

$this->assertEquals("csv--11,csv--12\ncsv--31,csv--32", $writtenContent, 'Empty rows should be skipped');
}

/**
* @return void
*/
Expand Down

0 comments on commit 538f610

Please sign in to comment.