Make test case use SERVER_NAME conditionally.

This commit is contained in:
mark_story 2012-07-05 22:56:45 -04:00
parent f528bb29ba
commit 591022f182

View file

@ -1119,7 +1119,8 @@ class CakeEmailTest extends CakeTestCase {
$this->CakeEmail->template('image');
$this->CakeEmail->emailFormat('html');
$expected = '<img src="http://' . env('SERVER_NAME') . '/img/image.gif" alt="cool image" width="100" height="100" />';
$server = env('SERVER_NAME') ? env('SERVER_NAME') : 'localhost';
$expected = '<img src="http://' . $server . '/img/image.gif" alt="cool image" width="100" height="100" />';
$result = $this->CakeEmail->send();
$this->assertContains($expected, $result['message']);
}