diff --git a/tests/example_files/single_row.csv b/tests/example_files/single_row.csv new file mode 100644 index 0000000..3f2fd04 --- /dev/null +++ b/tests/example_files/single_row.csv @@ -0,0 +1,5 @@ +SMS +0444 +5555 +6606 +7777 \ No newline at end of file diff --git a/tests/methods/parse_test.php b/tests/methods/parse_test.php index a9f9563..17e54de 100644 --- a/tests/methods/parse_test.php +++ b/tests/methods/parse_test.php @@ -29,13 +29,25 @@ class parse_test extends PHPUnit_Framework_TestCase { private function parse_repetitive_string($content) { $this->csv->delimiter = ';'; - $this->csv->heading = FALSE; + $this->csv->heading = false; $success = $this->csv->parse(str_repeat($content . ';', 500)); - $this->assertEquals(TRUE, $success); + $this->assertEquals(true, $success); $row = array_pop($this->csv->data); $expected_data = array_fill(0, 500, $content); $expected_data [] = ''; $this->assertEquals($expected_data, $row); } + + public function test_single_row() { + $this->csv->auto(__DIR__ . '/../example_files/single_row.csv'); + $expected = [ + ['SMS' => '0444'], + ['SMS' => '5555'], + ['SMS' => '6606'], + ['SMS' => '7777'], + ]; + + $this->assertEquals($expected, $this->csv->data); + } }