mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MNT Adjust a couple of unit tests to run from recipe-kitchen-sink
This commit is contained in:
parent
29fa365d10
commit
081537d014
@ -44,28 +44,29 @@ class MemoryLimitTest extends SapphireTest
|
|||||||
{
|
{
|
||||||
// ini_set('memory_limit', '64M');
|
// ini_set('memory_limit', '64M');
|
||||||
// current memory usage in travis is 197M, can't ini_set this down to 64M
|
// current memory usage in travis is 197M, can't ini_set this down to 64M
|
||||||
|
// for recipe-kitchen-sink, it's 284M
|
||||||
// Using a higher memory limit instead
|
// Using a higher memory limit instead
|
||||||
ini_set('memory_limit', '230M');
|
ini_set('memory_limit', '330M');
|
||||||
Environment::setMemoryLimitMax('256M');
|
Environment::setMemoryLimitMax('512M');
|
||||||
|
|
||||||
// It can go up
|
// It can go up
|
||||||
Environment::increaseMemoryLimitTo('240M');
|
Environment::increaseMemoryLimitTo('340M');
|
||||||
$this->assertEquals('240M', ini_get('memory_limit'));
|
$this->assertEquals('340M', ini_get('memory_limit'));
|
||||||
|
|
||||||
// But not down
|
// But not down
|
||||||
Environment::increaseMemoryLimitTo('220M');
|
Environment::increaseMemoryLimitTo('320M');
|
||||||
$this->assertEquals('240M', ini_get('memory_limit'));
|
$this->assertEquals('340M', ini_get('memory_limit'));
|
||||||
|
|
||||||
// Test the different kinds of syntaxes
|
// Test the different kinds of syntaxes
|
||||||
Environment::increaseMemoryLimitTo(1024*1024*250);
|
Environment::increaseMemoryLimitTo(1024*1024*350);
|
||||||
$this->assertEquals('250M', ini_get('memory_limit'));
|
$this->assertEquals('350M', ini_get('memory_limit'));
|
||||||
|
|
||||||
Environment::increaseMemoryLimitTo('109600K');
|
Environment::increaseMemoryLimitTo('109600K');
|
||||||
$this->assertEquals('250M', ini_get('memory_limit'));
|
$this->assertEquals('350M', ini_get('memory_limit'));
|
||||||
|
|
||||||
// Attempting to increase past max size only sets to max
|
// Attempting to increase past max size only sets to max
|
||||||
Environment::increaseMemoryLimitTo('1G');
|
Environment::increaseMemoryLimitTo('1G');
|
||||||
$this->assertEquals('256M', ini_get('memory_limit'));
|
$this->assertEquals('512M', ini_get('memory_limit'));
|
||||||
|
|
||||||
// No argument means unlimited (but only if originally allowed)
|
// No argument means unlimited (but only if originally allowed)
|
||||||
if (is_numeric($this->origMemLimitMax) && $this->origMemLimitMax < 0) {
|
if (is_numeric($this->origMemLimitMax) && $this->origMemLimitMax < 0) {
|
||||||
|
@ -23,7 +23,7 @@ class DetailedErrorFormatterTest extends SapphireTest
|
|||||||
$this->assertStringContainsString("Line 32 in $base/DetailedErrorFormatterTest/ErrorGenerator.php", $output);
|
$this->assertStringContainsString("Line 32 in $base/DetailedErrorFormatterTest/ErrorGenerator.php", $output);
|
||||||
$this->assertStringContainsString('* 32: throw new Exception(\'Error\');', $output);
|
$this->assertStringContainsString('* 32: throw new Exception(\'Error\');', $output);
|
||||||
$this->assertStringContainsString(
|
$this->assertStringContainsString(
|
||||||
'SilverStripe\\Logging\\Tests\\DetailedErrorFormatterTest\\ErrorGenerator->mockException(4)',
|
'SilverStripe\\Logging\\Tests\\DetailedErrorFormatterTest\\ErrorGenerator->mockException',
|
||||||
$output
|
$output
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user