summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/WriterTest.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/WriterTest.php b/test/WriterTest.php
index a238f1a..2b43119 100644
--- a/test/WriterTest.php
+++ b/test/WriterTest.php
@@ -216,4 +216,14 @@ class WriterTest extends PHPUnit_Framework_TestCase
$reader = $this->csv->newReader();
$this->assertSame(['john', 'doe', 'john.doe@example.com'], $reader->fetchOne(0));
}
+
+
+ public function testCustomLineEnding()
+ {
+ $csv = Writer::createFromFileObject(new SplTempFileObject());
+ $csv->setLineEnding("\r\n");
+
+ $csv->insertOne(["jane", "doe"]);
+ $this->assertSame("jane,doe\r\n", (string) $csv);
+ }
}