BUGFIX: Fix MemoryLimitTest not to fail on machines with <1G of memory and later versions of PHP 5.2.x that check available memory before setting memory_limit setting.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87234 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-09-24 07:14:30 +00:00
parent 2402f308e1
commit a18724c243

View File

@ -21,7 +21,12 @@ class MemoryLimitTest extends SapphireTest {
$this->assertEquals('409600K', ini_get('memory_limit'));
increase_memory_limit_to('1G');
$this->assertEquals('1G', ini_get('memory_limit'));
// If memory limit was left at 409600K, that means that the current testbox doesn't have
// 1G of memory available. That's okay; let's not report a failure for that.
if(ini_get('memory_limit') != '409600K') {
$this->assertEquals('1G', ini_get('memory_limit'));
}
// No argument means unlimited
increase_memory_limit_to();