Skip to content

Commit

Permalink
Fix failing tests.
Browse files Browse the repository at this point in the history
Adding the MIME-Version header caused a few tests to fail.
  • Loading branch information
markstory committed Oct 12, 2014
1 parent 20ad0e1 commit 77730bb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cake/tests/cases/libs/controller/components/email.test.php
Expand Up @@ -551,6 +551,7 @@ function testSendFormats() {
Date: $date
X-Mailer: CakePHP Email Component
Content-Type: {CONTENTTYPE}
MIME-Version: 1.0
Content-Transfer-Encoding: 7bitParameters:
Message:
Expand Down Expand Up @@ -608,6 +609,7 @@ function testTemplates() {
Date: $date
X-Mailer: CakePHP Email Component
Content-Type: {CONTENTTYPE}
MIME-Version: 1.0
Content-Transfer-Encoding: 7bitParameters:
Message:
Expand Down Expand Up @@ -655,8 +657,14 @@ function testTemplates() {
$boundary = $this->Controller->EmailTest->getBoundary();

$expect = str_replace('{CONTENTTYPE}', 'multipart/alternative; boundary="alt-' . $boundary . '"', $header);
$expect .= '--alt-' . $boundary . "\n" . 'Content-Type: text/plain; charset=UTF-8' . "\n" . 'Content-Transfer-Encoding: 7bit' . "\n\n" . $text . "\n\n";
$expect .= '--alt-' . $boundary . "\n" . 'Content-Type: text/html; charset=UTF-8' . "\n" . 'Content-Transfer-Encoding: 7bit' . "\n\n" . $html . "\n\n";
$expect .= '--alt-' . $boundary . "\n" .
'Content-Type: text/plain; charset=UTF-8' . "\n" .
'Content-Transfer-Encoding: 7bit' .
"\n\n" . $text . "\n\n";
$expect .= '--alt-' . $boundary . "\n" .
'Content-Type: text/html; charset=UTF-8' . "\n" .
'Content-Transfer-Encoding: 7bit' .
"\n\n" . $html . "\n\n";
$expect = '<pre>' . $expect . "--alt-$boundary--" . "\n\n" . '</pre>';
$this->assertEqual($this->Controller->Session->read('Message.email.message'), $this->__osFix($expect));

Expand Down Expand Up @@ -692,7 +700,7 @@ function testTemplates() {
$expect = str_replace('{CONTENTTYPE}', 'text/html; charset=UTF-8', $header) . $html;
$expect = '<pre>' . $expect . '</pre>';
$this->assertEqual($this->Controller->Session->read('Message.email.message'), $this->__osFix($expect));

$result = ClassRegistry::getObject('view');
$this->assertFalse($result);
}
Expand Down

0 comments on commit 77730bb

Please sign in to comment.