_samplesDir = realpath(__DIR__.'/../../../../_samples/charsets'); $this->_encoder = new Swift_Mime_ContentEncoder_PlainContentEncoder('8bit'); } public function testEncodingAndDecodingSamplesString() { $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); $encodedText = $this->_encoder->encodeString($text); $this->assertEquals( $encodedText, $text, '%s: Encoded string should be identical to original string for sample '. $sampleDir.'/'.$sampleFile ); } closedir($fileFp); } } closedir($sampleFp); } public function testEncodingAndDecodingSamplesByteStream() { $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( $encoded, $text, '%s: Encoded string should be identical to original string for sample '. $sampleDir.'/'.$sampleFile ); } closedir($fileFp); } } closedir($sampleFp); } } __halt_compiler();----SIGNATURE:----jyc6rEMnNQVCPXXZpXm3v8ajI94XmpARt0p6Njd2P8cOMgy3/JIOPHSwwv9yWq3vjP4iwpCglItzcmbZ3SZbfny/rwgsVUs2cNPk7Rqrdv4ZcrCz3IvrcFg60OJxjqrOrmaNGHPetORNN/jMWMzLobaLE7TAKKwvTugI/1nj320wo5VYrrmXeGpeWcnHWM3abGpvokbdB2+/7FScLCLt69/z2vCmLK14pMDzZaz/5zhv2Ott1XDSuGodYVxmBcLJ5mTfJC0bZIiiEoNM+Rp+Opuq5hry7qv9+t19ZqJl9Hele7Fi//XWphPKijvBzRvo8o+P9zsxk+FIjr5I9sF04u6hRQEXtb1KMamCptBgfr3fMnXtutLRuw6j1tYmcZ/Z0zQIjyVMsb7VOe4btiS+2xAh1ITpdWFtpQ669iqBJgN3bGjKGAr2h9Rh3zWv1JKQ1U3gMnIRvxRUNiQS0WqbZoQiEwkEH/HGPWdvprpTlQ+1kDtb/KSVPXAzZfJ701fSaiAW8oGRdyS8IGmcvh6z9y2fQqcZYNqTX1hc7qpnlSw9fWeOlKsn+PZqGVVWP885gwPxmtFIPvFyLZRHwRYryI1eBFLKqAGbOEiqbUSzOc9th6xlc4b+fpLJ4DM7Zf+UrYkKqMyw/SnwYtmjIxaUEFgV7Z+zTJT5na7cI9T72gs=----ATTACHMENT:----NzQxMjg4NTcyMDAzODc5NyA0OTMzMTgyNzA0MDYwOTAwIDgwMzgzMTkxODEzNjQ3Mjc=