assertEquals(['one', 'two', 'three'], $this->splitLines("one\r\ntwo\r\nthree")); $this->assertEquals(['one', 'two', 'three'], $this->splitLines("one\ntwo\nthree")); $this->assertEquals(['one', 'two', 'three'], $this->splitLines("one\rtwo\rthree")); $this->assertEquals(['one', '', 'two', 'three'], $this->splitLines("one\n\ntwo\nthree")); $this->assertEquals(['one', '', 'two', '', 'three'], $this->splitLines("one\r\n\ntwo\n\r\nthree")); // the unusual \n\r sequence $this->assertEquals(['one', 'two', 'three'], $this->splitLines("one\n\rtwo\n\rthree")); $this->assertEquals(['one', '', 'two', '', 'three'], $this->splitLines("one\n\r\ntwo\n\n\rthree")); } public function testLineSplittingNoEmpty() { $this->assertEquals(['one', 'two', 'three'], $this->splitLinesNoEmpty("one\r\ntwo\r\nthree")); $this->assertEquals(['one', 'two', 'three'], $this->splitLinesNoEmpty("one\ntwo\nthree")); $this->assertEquals(['one', 'two', 'three'], $this->splitLinesNoEmpty("one\rtwo\rthree")); $this->assertEquals(['one', 'two', 'three'], $this->splitLinesNoEmpty("one\n\ntwo\nthree")); $this->assertEquals(['one', 'two', 'three'], $this->splitLinesNoEmpty("one\r\n\ntwo\n\r\nthree")); // the unusual \n\r sequence $this->assertEquals(['one', 'two', 'three'], $this->splitLinesNoEmpty("one\n\rtwo\n\rthree")); $this->assertEquals(['one', 'two', 'three'], $this->splitLinesNoEmpty("one\n\r\ntwo\n\n\rthree")); } }