diff options
author | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2015-01-28 14:37:48 +0100 |
---|---|---|
committer | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2015-01-28 14:37:48 +0100 |
commit | 55461b3c43df3a2e12576e27c067fcea5dc73f68 (patch) | |
tree | ec92b166f56b440afc0dc2c5d4a0432038584abb /test | |
parent | 068f97c3fb7d72bb7b1e814398f74d20a0bde11f (diff) | |
download | csv-55461b3c43df3a2e12576e27c067fcea5dc73f68.zip csv-55461b3c43df3a2e12576e27c067fcea5dc73f68.tar.gz csv-55461b3c43df3a2e12576e27c067fcea5dc73f68.tar.bz2 |
adding Writer::useValidation method
Diffstat (limited to 'test')
-rw-r--r-- | test/WriterTest.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/WriterTest.php b/test/WriterTest.php index 06e2db7..1cc07e7 100644 --- a/test/WriterTest.php +++ b/test/WriterTest.php @@ -111,7 +111,7 @@ class WriterTest extends PHPUnit_Framework_TestCase $this->assertSame(['john', '', 'john.doe@example.com'], $res); } - public function testInsertWithoutValidation() + public function testInsertWithoutNullHandlingMode() { $expected = [ ['john', 'doe', 'john.doe@example.com'], @@ -128,6 +128,21 @@ class WriterTest extends PHPUnit_Framework_TestCase } /** + * @expectedException PHPUnit_Framework_Error + */ + public function testInsertWithoutValidation() + { + $expected = [ + ['john', 'doe', 'john.doe@example.com'], + 'john,doe,john.doe@example.com', + ['john', null, 'john.doe@example.com'], + new \StdClass, + ]; + $this->csv->useValidation(false); + $this->csv->insertAll($expected); + } + + /** * @expectedException InvalidArgumentException * @expectedExceptionMessage */ |