Permalink
Browse files

Added test for ISO-2022-JP to demonstration fail for charset. Thanks @…

  • Loading branch information...
1 parent bd29145 commit cef441c16b66cee9129a17016c5bfbea5b519937 @predominant predominant committed Oct 19, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
@@ -273,6 +273,24 @@ public function testFormatAddress() {
$result = $this->CakeEmail->formatAddress(array('cake@cakephp.org' => 'ÄÖÜTest'));
$expected = array('=?UTF-8?B?w4TDlsOcVGVzdA==?= <cake@cakephp.org>');
$this->assertIdentical($expected, $result);
+
+ $result = $this->CakeEmail->formatAddress(array('cake@cakephp.org' => '日本語Test'));
+ $expected = array('=?UTF-8?B?5pel5pys6KqeVGVzdA==?= <cake@cakephp.org>');
+ $this->assertIdentical($expected, $result);
+ }
+
+/**
+ * testFormatAddressJapanese
+ *
+ * @return void
+ */
+ public function testFormatAddressJapanese() {
+ $this->skipIf(!function_exists('mb_convert_encoding'));
+
+ $this->CakeEmail->charset = 'ISO-2022-JP';
+ $result = $this->CakeEmail->formatAddress(array('cake@cakephp.org' => '日本語Test'));
+ $expected = array('=?ISO-2022-JP?B?GyRCRnxLXDhsGyhCVGVzdA==?= <cake@cakephp.org>');
+ $this->assertIdentical($expected, $result);
}
/**

0 comments on commit cef441c

Please sign in to comment.