mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Preserve memory_limit between tests (for better PHP5.1 behaviour)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@106128 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
493fb1be55
commit
2f9dddc0ea
@ -28,6 +28,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
protected $originalIsRunningTest;
|
||||
protected $originalTheme;
|
||||
protected $originalNestedURLsState;
|
||||
protected $originalMemoryLimit;
|
||||
|
||||
protected $mailer;
|
||||
|
||||
@ -157,6 +158,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
$this->mailer = new TestMailer();
|
||||
Email::set_mailer($this->mailer);
|
||||
Email::send_all_emails_to(null);
|
||||
|
||||
// Preserve memory settings
|
||||
$this->originalMemoryLimit = ini_get('memory_limit');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -337,6 +341,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
// Preserve memory settings
|
||||
ini_set('memory_limit', $this->originalMemoryLimit);
|
||||
|
||||
// Restore email configuration
|
||||
Email::set_mailer($this->originalMailer);
|
||||
$this->originalMailer = null;
|
||||
|
Loading…
Reference in New Issue
Block a user