/** * @test */ public function writeLineAndReadLineEndings() { $sendPartOne = $this->_testString . " writeLineAndReadLineEndings"; $sendPartTwo = $sendPartOne . " after tab symbol\n"; $string = $sendPartOne . "\t" . $sendPartTwo; $this->_clientStream->write($string); $partOne = $this->_serverStream->readLineEndings(1024, "\t"); $this->assertEquals($sendPartOne, $partOne); $partTwo = $this->_serverStream->readLine(); $this->assertEquals($sendPartTwo, $partTwo); /** * This function is nearly identical to fgets() except in that it allows end of line delimiters other * than the standard \n, \r, and \r\n, and does not return the delimiter itself. */ $this->assertEquals(strlen($string) - 1, $this->_serverStream->getReadBytes()); }