Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIX: Set up the test mailer before loading the fixture, in case fixtu…

…re-creation causes emails to be generated.
  • Loading branch information...
commit b7a1db7ce31f4712a6578d9db88f6f0601a0a11a 1 parent c3a3ff4
@sminnee sminnee authored chillu committed
Showing with 8 additions and 7 deletions.
  1. +8 −7 dev/SapphireTest.php
View
15 dev/SapphireTest.php
@@ -205,8 +205,16 @@ public function setUp() {
$className = get_class($this);
$fixtureFile = eval("return {$className}::\$fixture_file;");
+
$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';
+ // Set up email
+ $this->originalMailer = Email::mailer();
+ $this->mailer = new TestMailer();
+ Email::set_mailer($this->mailer);
+ Config::inst()->remove('Email', 'send_all_emails_to');
+ Email::send_all_emails_to(null);
+
// Todo: this could be a special test model
$this->model = DataModel::inst();
@@ -259,13 +267,6 @@ public function setUp() {
$this->logInWithPermission("ADMIN");
}
- // Set up email
- $this->originalMailer = Email::mailer();
- $this->mailer = new TestMailer();
- Email::set_mailer($this->mailer);
- Config::inst()->remove('Email', 'send_all_emails_to');
- Email::send_all_emails_to(null);
-
// Preserve memory settings
$this->originalMemoryLimit = ini_get('memory_limit');
Please sign in to comment.
Something went wrong with that request. Please try again.