diff --git a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php index 2f60ca9eece..fdfee55e58d 100644 --- a/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php @@ -850,7 +850,8 @@ public function testMessageId() { $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); $result = DebugCompTransport::$lastEmail; - $this->assertRegExp('/Message-ID: \<[a-f0-9]{8}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{12}@' . env('HTTP_HOST') . '\>\n/', $result); + $host = env('HTTP_HOST') ? env('HTTP_HOST') : php_uname('n'); + $this->assertRegExp('/Message-ID: \<[a-f0-9]{8}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{4}[a-f0-9]{12}@' . $host . '\>\n/', $result); $this->Controller->EmailTest->messageId = '<22091985.998877@example.com>';