summaryrefslogtreecommitdiffstats
path: root/test/WriterTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'test/WriterTest.php')
-rw-r--r--test/WriterTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/WriterTest.php b/test/WriterTest.php
index 00f152c..d4dd0ef 100644
--- a/test/WriterTest.php
+++ b/test/WriterTest.php
@@ -111,6 +111,23 @@ class WriterTest extends PHPUnit_Framework_TestCase
$this->assertSame(['john', '', 'john.doe@example.com'], $res);
}
+ public function testInsertWithoutValidation()
+ {
+ $expected = [
+ ['john', 'doe', 'john.doe@example.com'],
+ 'john,doe,john.doe@example.com',
+ ['john', null, 'john.doe@example.com'],
+ ];
+ $this->csv->setNullHandlingMode(Writer::NULL_AS_EMPTY);
+ $this->csv->setCellContentValidation(false);
+ $this->csv->insertAll($expected);
+
+ $iterator = new LimitIterator($this->csv->getIterator(), 2, 1);
+ $iterator->rewind();
+ $res = $iterator->getInnerIterator()->current();
+ $this->assertSame(['john', '', 'john.doe@example.com'], $res);
+ }
+
/**
* @expectedException InvalidArgumentException
* @expectedExceptionMessage