Browse Source

Merge pull request #796 from MrRio/ticket-3152

Fix Email test fails when not running on port 80  

Fixes #3152
Mark Story 13 years ago
parent
commit
a553142a0a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/Cake/Test/Case/Network/Email/CakeEmailTest.php

+ 5 - 1
lib/Cake/Test/Case/Network/Email/CakeEmailTest.php

@@ -1118,8 +1118,12 @@ class CakeEmailTest extends CakeTestCase {
 		$this->CakeEmail->config(array('empty'));
 		$this->CakeEmail->template('image');
 		$this->CakeEmail->emailFormat('html');
-
 		$server = env('SERVER_NAME') ? env('SERVER_NAME') : 'localhost';
+				
+		if (env('SERVER_PORT') != null && env('SERVER_PORT') != 80) {
+			$server .= ':' . env('SERVER_PORT');
+		}
+				
 		$expected = '<img src="http://' . $server . '/img/image.gif" alt="cool image" width="100" height="100" />';
 		$result = $this->CakeEmail->send();
 		$this->assertContains($expected, $result['message']);