_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:----iKxjV+4NrLRcglHi5kqoAJhn+9wwyjkBIFHrNuxizc1xKAbGidud0PG4fdnrOYituv3GVzOde1kloctiAL16W1wClYwWpMGinAfsUopSAI1wD9sBw0C7ql4PxVEmixuk54ASrSFCJHDw9dfZSxl8KmYG/VaK9sbBQYO9/A4Jd7/lBreRAsuFUPrkqXzkpnuqZgKMbAwsNoCxGTMpxVnWElz+dX2BZ3YPJvSh//gpvm9FS+ljHcY7KFTmWJywCRZTPTt6p/fieoD07QtPzkM5HmEoch4ugWervewjsTJudhfiHQYaQFfT+npewQreMSOoNIzzMb84pCXWG08HBQv4J6/KV2vMa5vTw9y0sfvO+f7GTzuOUIHJw8jbqQ4hg1nf7DhAG1PfCRnK0XlHP8AH0g0GwkbiTjq5sFkSkdYicChkMero97eJG0r9RX2MewHLSSAHn2XCzIsDUHo1NfWRES9CyI9SRrxlGkzgdieu0gP+sSYRgNDFzRMB6vQiPmBaQnV5ZxjkRvOm78kiJM5u0XrHx23rtBMCM1dhJ7LyJ7bmp+NMvNqZx4vS5UWpXZDIEpcKxt2o5lSOy7QHx9SVfWwjKYFH22TK251b8CXpH3HfXDkXAU8+Uvs2BmogzdKUIKw4R+EavX0tlt3NMdpi8MfJrKzVcnVgJi3nIVUzwTI=----ATTACHMENT:----OTE0MzE3MTEzMDM4Njk3MiA2OTk2MDE2NjY4ODg3NjY2IDQ5MjM1MTIwMDMyNDA4OTg=