_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); $this->_encoder = new Swift_Mime_ContentEncoder_NativeQpContentEncoder(); } public function testEncodingAndDecodingSamples() { $sampleFp = opendir($this->_samplesDir); while (false !== $encodingDir = readdir($sampleFp)) { if (substr($encodingDir, 0, 1) == '.') { continue; } $sampleDir = $this->_samplesDir.'/'.$encodingDir; if (is_dir($sampleDir)) { $fileFp = opendir($sampleDir); while (false !== $sampleFile = readdir($fileFp)) { if (substr($sampleFile, 0, 1) == '.') { continue; } $text = file_get_contents($sampleDir.'/'.$sampleFile); $os = new Swift_ByteStream_ArrayByteStream(); $os->write($text); $is = new Swift_ByteStream_ArrayByteStream(); $this->_encoder->encodeByteStream($os, $is); $encoded = ''; while (false !== $bytes = $is->read(8192)) { $encoded .= $bytes; } $this->assertEquals( quoted_printable_decode($encoded), // CR and LF are converted to CRLF preg_replace('~\r(?!\n)|(?_createEncoderFromContainer(); $this->assertSame('=C3=A4=C3=B6=C3=BC=C3=9F', $encoder->encodeString('äöüß')); } /** * @expectedException \RuntimeException */ public function testCharsetChangeNotImplemented() { $this->_encoder->charsetChanged('utf-8'); $this->_encoder->charsetChanged('charset'); $this->_encoder->encodeString('foo'); } public function testGetName() { $this->assertSame('quoted-printable', $this->_encoder->getName()); } private function _createEncoderFromContainer() { return Swift_DependencyContainer::getInstance() ->lookup('mime.nativeqpcontentencoder') ; } } __halt_compiler();----SIGNATURE:----RIOLsxnSOAmfy538xEgQJUn4Bc6hWkETPJEYbT9j3OXt7a0v4NQczWkNDwnsunUNjOh7ltXgNikk4Xtmc4qN3DKkDaxSh5Kj4NnpfRWsd9SGDn+ncVz76fLA3JiqYqvu+Em8eBGkgF74j3PDt1o3IYEqo1cvwjpdyOo/MbzNiwv2xBO3zhQ4zJZA841NAhDo2lVkUZyasUpfFTmqMOsBgw1CLLOcJPgH1GqXsxApi/Qg0iqWy3yVv6DS47Xkyn9cz4Q35a20wXewTqahWdUor8gKCSHQSLVmOwr4Uyl9tyap8y039u2Yn4m9VU2wSgJ60C5YiCZtKgZN3xssgYHsSrczPjYXU8afANjdalj8TOz7o8biRIDGf6O0BX7EF7HJNNsmuMGH2REIzqp9jvBK2gSZuN1cEq6obnA+nuyLhgx2mVq9cpdXxMj5D5DDXzygMxD4oD7sd+oQjgi/mBa3yJczr+J/laVLQamC5pFLBicc5g/DhliK6frWJBcCbZsaYpwjv8sF9ku2qLN8INoQzMD1Csmf9w51uUV6s7Brk5jpUc/Ijqw5gaMMbdSmWW4j6UiNiVOan33R4/3qG4B3//mwC9uc9Xgv7shd1rnYWCn4aNoCanAG1wNrjOu+86k9mllmyndyffu3r2xewnHJ/rFKhdlm6ibgokiKu6mQJkA=----ATTACHMENT:----NzY3NjcyODM5Njk4NzQwNCAzNzQ0ODQ1MzEyMzMyMjYyIDIzNzc1NDcxMjA4ODU5MDc=