Exemple #1
0
 public function testHeaderCharsetConversion()
 {
     $hdrs = new Horde_Mime_Headers();
     $hdrs->addHeader('To', 'Empfänger <*****@*****.**>');
     $hdr_array = $hdrs->toArray(array('charset' => 'iso-8859-1'));
     $this->assertEquals('=?iso-8859-1?b?RW1wZuRuZ2Vy?= <*****@*****.**>', $hdr_array['To']);
 }
Exemple #2
0
 /**
  * @dataProvider headerEncodeProvider
  */
 public function testHeaderEncode($header, $values, $charset, $encoded)
 {
     $hdrs = new Horde_Mime_Headers();
     foreach ($values as $val) {
         $hdrs->addHeader($header, $val);
     }
     $hdr_encode = $hdrs[$header]->sendEncode(array('charset' => $charset));
     $this->assertEquals($encoded, $hdr_encode);
     $hdr_array = $hdrs->toArray(array('charset' => $charset));
     $this->assertEquals(count($encoded) > 1 ? $encoded : reset($encoded), $hdr_array[$header]);
 }