Skip to content
Browse files

Adding tests for testSendDebug

  • Loading branch information...
1 parent 73e6597 commit cddfd71b7d874d19acbf39044b362a430fb3c213 @jperras jperras committed
Showing with 13 additions and 1 deletion.
  1. +13 −1 cake/tests/cases/libs/controller/components/email.test.php
View
14 cake/tests/cases/libs/controller/components/email.test.php
@@ -532,14 +532,26 @@ function testSendDebug() {
$this->Controller->EmailTest->reset();
$this->Controller->EmailTest->to = 'postmaster@localhost';
$this->Controller->EmailTest->from = 'noreply@example.com';
- $this->Controller->EmailTest->subject = 'Cake SMTP test';
+ $this->Controller->EmailTest->subject = 'Cake Debug Test';
$this->Controller->EmailTest->replyTo = 'noreply@example.com';
$this->Controller->EmailTest->template = null;
$this->Controller->EmailTest->delivery = 'debug';
$this->assertTrue($this->Controller->EmailTest->send('This is the body of the message'));
+ $result = $this->Controller->Session->read('Message.email.message');
+
+ $this->assertPattern('/To: postmaster@localhost/', $result);
+ $this->assertPattern('/Subject: Cake Debug Test/', $result);
+ $this->assertPattern('/Reply-To: noreply@example.com/', $result);
+ $this->assertPattern('/From: noreply@example.com/', $result);
+ $this->assertPattern('/X-Mailer: CakePHP Email Component/', $result);
+ $this->assertPattern('/Content-Type: text\/plain; charset=UTF-8/', $result);
+ $this->assertPattern('/Content-Transfer-Encoding: 7bitParameters:/', $result);
+ $this->assertPattern('/This is the body of the message/', $result);
+
}
+
/**
* testContentStripping method
*

0 comments on commit cddfd71

Please sign in to comment.
Something went wrong with that request. Please try again.