summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/WriterTest.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/WriterTest.php b/test/WriterTest.php
index d4dd0ef..22f1137 100644
--- a/test/WriterTest.php
+++ b/test/WriterTest.php
@@ -119,7 +119,7 @@ class WriterTest extends PHPUnit_Framework_TestCase
['john', null, 'john.doe@example.com'],
];
$this->csv->setNullHandlingMode(Writer::NULL_AS_EMPTY);
- $this->csv->setCellContentValidation(false);
+ $this->csv->useFormatValidation(false);
$this->csv->insertAll($expected);
$iterator = new LimitIterator($this->csv->getIterator(), 2, 1);
@@ -243,4 +243,13 @@ class WriterTest extends PHPUnit_Framework_TestCase
$csv->insertOne(["jane", "doe"]);
$this->assertSame("jane,doe\r\n", (string) $csv);
}
+
+ public function testCustomNewlineFromCreateFromString()
+ {
+ $expected = "\r\n";
+ $raw = "john,doe,john.doe@example.com".PHP_EOL
+ ."jane,doe,jane.doe@example.com".PHP_EOL;
+ $csv = Writer::createFromString($raw, $expected);
+ $this->assertSame($expected, $csv->getNewline());
+ }
}