mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing transport test, as transport class now returns as stated in RFC 2822
This commit is contained in:
parent
3be9a8a5e8
commit
87ffd92c2b
3 changed files with 14 additions and 7 deletions
|
@ -85,5 +85,4 @@ class EmailConfig {
|
|||
'client' => null
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -85,5 +85,4 @@ class EmailConfig {
|
|||
'client' => null
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -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'));
|
||||
|
@ -53,10 +62,10 @@ class DebugTransportTest extends CakeTestCase {
|
|||
$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']);
|
||||
|
|
Loading…
Reference in a new issue