Skip to content
Permalink
Browse files

Adding test for EmailComponent::send() where is a numerically indexed…

… array.
  • Loading branch information...
jperras committed Aug 9, 2009
1 parent cddfd71 commit 8a9dfb513eb8045b27b0750d18d50c0a21c357f1
Showing with 31 additions and 0 deletions.
  1. +31 −0 cake/tests/cases/libs/controller/components/email.test.php
@@ -551,6 +551,37 @@ function testSendDebug() {
}
/**
* testContentArray method
*
* @access public
* @return void
*/
function testSendContentArray() {
$this->Controller->EmailTest->reset();
$this->Controller->EmailTest->to = 'postmaster@localhost';
$this->Controller->EmailTest->from = 'noreply@example.com';
$this->Controller->EmailTest->subject = 'Cake Debug Test';
$this->Controller->EmailTest->replyTo = 'noreply@example.com';
$this->Controller->EmailTest->template = null;
$this->Controller->EmailTest->delivery = 'debug';
$content = array('First line', 'Second line', 'Third line');
$this->assertTrue($this->Controller->EmailTest->send($content));
$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('/First line\n/', $result);
$this->assertPattern('/Second line\n/', $result);
$this->assertPattern('/Third line\n/', $result);
}
/**
* testContentStripping method

0 comments on commit 8a9dfb5

Please sign in to comment.
You can’t perform that action at this time.