Skip to content

Commit

Permalink
Fixing transport test, as transport class now returns as stated in RF…
Browse files Browse the repository at this point in the history
…C 2822
  • Loading branch information
ceeram committed Aug 29, 2011
1 parent 3be9a8a commit 87ffd92
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion app/Config/email.php.default
Expand Up @@ -85,5 +85,4 @@ class EmailConfig {
'client' => null
);


}
1 change: 0 additions & 1 deletion lib/Cake/Console/Templates/skel/Config/email.php.default
Expand Up @@ -85,5 +85,4 @@ class EmailConfig {
'client' => null
);


}
19 changes: 14 additions & 5 deletions lib/Cake/Test/Case/Network/Email/DebugTransportTest.php
Expand Up @@ -17,13 +17,22 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('CakeEmail', 'Network/Email');

App::uses('AbstractTransport', 'Network/Email');
App::uses('DebugTransport', 'Network/Email');
/**
* Test case
*
*/
class DebugTransportTest extends CakeTestCase {

/**
* Setup
*
* @return void
*/
public function setUp() {
$this->DebugTransport = new DebugTransport();
}

/**
* testSend method
Expand All @@ -32,7 +41,7 @@ class DebugTransportTest extends CakeTestCase {
*/
public function testSend() {
$this->getMock('CakeEmail', array('message'), array(), 'DebugCakeEmail');
$email = new DebugCakeEmail(array('transport' => 'Debug'));
$email = new DebugCakeEmail();
$email->from('noreply@cakephp.org', 'CakePHP Test');
$email->to('cake@cakephp.org', 'CakePHP');
$email->cc(array('mark@cakephp.org' => 'Mark Story', 'juan@cakephp.org' => 'Juan Basso'));
Expand All @@ -53,10 +62,10 @@ public function testSend() {
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
$headers .= "Content-Transfer-Encoding: 7bit";

$data = "First Line\n";
$data .= "Second Line\n";
$data = "First Line\r\n";
$data .= "Second Line\r\n";

$result = $email->transportClass()->send($email);
$result = $this->DebugTransport->send($email);

$this->assertEquals($headers, $result['headers']);
$this->assertEquals($data, $result['message']);
Expand Down

0 comments on commit 87ffd92

Please sign in to comment.