Permalink
Browse files

Fixing test cases for EmailComponent

  • Loading branch information...
1 parent 15ca240 commit 70ae66edf7a0dccae40b1e004d190cf0a1a73170 @ADmad ADmad committed Nov 26, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 cake/tests/cases/libs/controller/components/email.test.php
@@ -693,7 +693,7 @@ function testSendDebug() {
$this->assertPattern('/Subject: Cake Debug Test\n/', $result);
$this->assertPattern('/Reply-To: noreply@example.com\n/', $result);
$this->assertPattern('/From: noreply@example.com\n/', $result);
- $this->assertPattern('/Date: ' . date(DATE_RFC2822) . '\n/', $result);
+ $this->assertPattern('/Date: ' . preg_quote(date(DATE_RFC2822)) . '\n/', $result);
$this->assertPattern('/X-Mailer: CakePHP Email Component\n/', $result);
$this->assertPattern('/Content-Type: text\/plain; charset=UTF-8\n/', $result);
$this->assertPattern('/Content-Transfer-Encoding: 7bitParameters:\n/', $result);
@@ -721,7 +721,7 @@ function testSendDebugWithNoSessions() {
$this->assertPattern('/Subject: Cake Debug Test\n/', $result);
$this->assertPattern('/Reply-To: noreply@example.com\n/', $result);
$this->assertPattern('/From: noreply@example.com\n/', $result);
- $this->assertPattern('/Date: ' . date(DATE_RFC2822) . '\n/', $result);
+ $this->assertPattern('/Date: ' . preg_quote(date(DATE_RFC2822)) . '\n/', $result);
$this->assertPattern('/X-Mailer: CakePHP Email Component\n/', $result);
$this->assertPattern('/Content-Type: text\/plain; charset=UTF-8\n/', $result);
$this->assertPattern('/Content-Transfer-Encoding: 7bitParameters:\n/', $result);
@@ -1217,10 +1217,10 @@ function testFormatAddressAliases() {
$result = $this->Controller->EmailTest->formatAddress('email@example.com', true);
$this->assertEqual($result, '<email@example.com>');
-
+
$result = $this->Controller->EmailTest->formatAddress('<email@example.com>', true);
$this->assertEqual($result, '<email@example.com>');
-
+
$result = $this->Controller->EmailTest->formatAddress('alias name <email@example.com>', true);
$this->assertEqual($result, '<email@example.com>');
}

0 comments on commit 70ae66e

Please sign in to comment.