mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
fixed CakeEmail::reset, no initialized charset and headerCharset property
This commit is contained in:
parent
475a1596b7
commit
26b93afc3c
2 changed files with 18 additions and 2 deletions
|
@ -1152,6 +1152,8 @@ class CakeEmail {
|
|||
$this->_emailFormat = 'text';
|
||||
$this->_transportName = 'Mail';
|
||||
$this->_transportClass = null;
|
||||
$this->charset = 'utf-8';
|
||||
$this->headerCharset = null;
|
||||
$this->_attachments = array();
|
||||
$this->_config = array();
|
||||
return $this;
|
||||
|
|
|
@ -1237,8 +1237,8 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->assertContains($expected, $this->CakeEmail->message(CakeEmail::MESSAGE_TEXT));
|
||||
|
||||
$message = $this->CakeEmail->message();
|
||||
$this->assertContains('Content-Type: text/plain; charset=UTF-8', $message);
|
||||
$this->assertContains('Content-Type: text/html; charset=UTF-8', $message);
|
||||
$this->assertContains('Content-Type: text/plain; charset=utf-8', $message);
|
||||
$this->assertContains('Content-Type: text/html; charset=utf-8', $message);
|
||||
|
||||
// UTF-8 is 8bit
|
||||
$this->assertTrue($this->checkContentTransferEncoding($message, '8bit'));
|
||||
|
@ -1268,6 +1268,20 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->assertSame(null, $this->CakeEmail->theme());
|
||||
}
|
||||
|
||||
/**
|
||||
* testReset with charset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testResetWithCharset() {
|
||||
$this->CakeEmail->charset = 'ISO-2022-JP';
|
||||
$this->CakeEmail->reset();
|
||||
|
||||
$this->assertSame($this->CakeEmail->charset, 'utf-8', $this->CakeEmail->charset);
|
||||
$this->assertSame($this->CakeEmail->headerCharset, null, $this->CakeEmail->headerCharset);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testWrap method
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue