Skip to content

Commit 6d51ce5

Browse files
committed
Revert "Fixed failing smtp tests when testing on host other then hardcoded 'localhost'."
This change you cause the tests to fail when run through CLI This reverts commit f361509.
1 parent 6177203 commit 6d51ce5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testConnectEhlo() {
100100
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
101101
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
102102
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
103-
$this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n");
103+
$this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n");
104104
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
105105
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("250 Accepted\r\n"));
106106
$this->SmtpTransport->connect();
@@ -115,10 +115,10 @@ public function testConnectHelo() {
115115
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
116116
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
117117
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
118-
$this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n");
118+
$this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n");
119119
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
120120
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
121-
$this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n");
121+
$this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n");
122122
$this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false));
123123
$this->socket->expects($this->at(7))->method('read')->will($this->returnValue("250 Accepted\r\n"));
124124
$this->SmtpTransport->connect();
@@ -134,10 +134,10 @@ public function testConnectFail() {
134134
$this->socket->expects($this->any())->method('connect')->will($this->returnValue(true));
135135
$this->socket->expects($this->at(0))->method('read')->will($this->returnValue(false));
136136
$this->socket->expects($this->at(1))->method('read')->will($this->returnValue("220 Welcome message\r\n"));
137-
$this->socket->expects($this->at(2))->method('write')->with("EHLO " . env('HTTP_HOST') . "\r\n");
137+
$this->socket->expects($this->at(2))->method('write')->with("EHLO localhost\r\n");
138138
$this->socket->expects($this->at(3))->method('read')->will($this->returnValue(false));
139139
$this->socket->expects($this->at(4))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
140-
$this->socket->expects($this->at(5))->method('write')->with("HELO " . env('HTTP_HOST') . "\r\n");
140+
$this->socket->expects($this->at(5))->method('write')->with("HELO localhost\r\n");
141141
$this->socket->expects($this->at(6))->method('read')->will($this->returnValue(false));
142142
$this->socket->expects($this->at(7))->method('read')->will($this->returnValue("200 Not Accepted\r\n"));
143143
$this->SmtpTransport->connect();
@@ -259,4 +259,4 @@ public function testQuit() {
259259
$this->SmtpTransport->disconnect();
260260
}
261261

262-
}
262+
}

0 commit comments

Comments
 (0)