-
Notifications
You must be signed in to change notification settings - Fork 676
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get Mailer from: host name from variety of sources depending on serve…
…r configuration
- Loading branch information
1 parent
3c053c4
commit b51731d
Showing
4 changed files
with
59 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
require_once THINKUP_WEBAPP_PATH.'_lib/extlib/simpletest/autorun.php'; | ||
require_once THINKUP_WEBAPP_PATH.'config.inc.php'; | ||
|
||
class TestOfMailer extends ThinkUpBasicUnitTestCase { | ||
class TestOfMailer extends ThinkUpUnitTestCase { | ||
|
||
public function setUp() { | ||
parent::setUp(); | ||
|
@@ -59,12 +59,24 @@ public function testFromName() { | |
$email_body); | ||
|
||
$config->setValue("app_title_prefix", "My Other Installation of "); | ||
$_SERVER['HTTP_HOST'] = "my_other_hostname"; | ||
$_SERVER['HTTP_HOST'] = null; | ||
$_SERVER['SERVER_NAME'] = "my_other_hostname"; | ||
Mailer::mail('[email protected]', 'Testing 123', 'Me worky, yo?'); | ||
$email_body = Mailer::getLastMail(); | ||
$this->debug($email_body); | ||
$this->assertPattern('/From: "My Other Installation of ThinkUp" <notifications@my_other_hostname>/', | ||
$email_body); | ||
|
||
$config->setValue("app_title_prefix", "Yet Another Installation of "); | ||
$_SERVER['HTTP_HOST'] = null; | ||
$_SERVER['SERVER_NAME'] = null; | ||
$builder = FixtureBuilder::build('options', array('namespace'=>'application_options', | ||
'option_name'=>'server_name', 'option_value'=>'testservername') ); | ||
Mailer::mail('[email protected]', 'Testing 123', 'Me worky, yo?'); | ||
$email_body = Mailer::getLastMail(); | ||
$this->debug($email_body); | ||
$this->assertPattern('/From: "Yet Another Installation of ThinkUp" <notifications@testservername>/', | ||
$email_body); | ||
} | ||
|
||
public function testMandrill() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters