mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Fixed failing smtp tests when testing on host other then hardcoded 'localhost'.
This commit is contained in:
parent
fe9762d053
commit
f361509f10
1 changed files with 6 additions and 6 deletions
|
@ -100,7 +100,7 @@ class SmtpTransportTest extends CakeTestCase {
|
||||||
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
|
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
|
||||||
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
|
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
|
||||||
$this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n");
|
$this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n");
|
||||||
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("250 Accepted\r\n"));
|
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("250 Accepted\r\n"));
|
||||||
$this->SmtpTransport->connect();
|
$this->SmtpTransport->connect();
|
||||||
|
@ -115,10 +115,10 @@ class SmtpTransportTest extends CakeTestCase {
|
||||||
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
|
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
|
||||||
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
|
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
|
||||||
$this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n");
|
$this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n");
|
||||||
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
|
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
|
||||||
$this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n");
|
$this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n");
|
||||||
$this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(7))->method('read')->will($this->returnValue("250 Accepted\r\n"));
|
$this->socket->expects($this->at(7))->method('read')->will($this->returnValue("250 Accepted\r\n"));
|
||||||
$this->SmtpTransport->connect();
|
$this->SmtpTransport->connect();
|
||||||
|
@ -134,10 +134,10 @@ class SmtpTransportTest extends CakeTestCase {
|
||||||
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
|
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
|
||||||
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
|
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
|
||||||
$this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n");
|
$this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n");
|
||||||
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
|
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
|
||||||
$this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n");
|
$this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n");
|
||||||
$this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false));
|
$this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false));
|
||||||
$this->socket->expects($this->at(7))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
|
$this->socket->expects($this->at(7))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
|
||||||
$this->SmtpTransport->connect();
|
$this->SmtpTransport->connect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue