Skip to content

Commit

Permalink
Added test for ISO-2022-JP to demonstration fail for charset. Thanks @…
Browse files Browse the repository at this point in the history
  • Loading branch information
predominant committed Oct 19, 2011
1 parent bd29145 commit cef441c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit cef441c

Please sign in to comment.