public function testFrameInLegacyModeWontEncodeHeaders() { $frame = new Frame('SEND', ['my:var' => "\\multi\nline\r!"]); $frame->legacyMode(true); $result = $frame->__toString(); $expected = "SEND\nmy:var:\\multi\\nline\r!\n\n"; $this->assertEquals($expected, $result); }
public function testParserWontDecodeHeadersInLegacyMode() { $frame = "COMMAND\nX-Proof:Hello\\c\\r\\n \\\\World!\n\nBody"; $this->parser->legacyMode(true); $this->parser->addData($frame); $this->parser->parse(); $expected = new Frame('COMMAND', ['X-Proof' => "Hello\\c\\r\n \\\\World!"], "Body"); $expected->legacyMode(true); $actual = $this->parser->getFrame(); $this->assertEquals($expected, $actual); }