diff --git a/core/modules/simpletest/tests/bootstrap.test b/core/modules/simpletest/tests/bootstrap.test index 5c8239c..d572803 100644 --- a/core/modules/simpletest/tests/bootstrap.test +++ b/core/modules/simpletest/tests/bootstrap.test @@ -461,17 +461,20 @@ class BootstrapMiscTestCase extends DrupalUnitTestCase { } /** - * Tests that the drupal_check_memory_limit function works as expected. + * Tests that the drupal_check_memory_limit() function works as expected. */ function testCheckMemoryLimit() { // Test that a very reasonable amount of memory is available. - $this->assertTrue(drupal_check_memory_limit('30MB'), t('30MB of memory tested available.')); + $this->assertTrue(drupal_check_memory_limit('30MB'), '30MB of memory tested available.'); + // Get the available memory and multiply it by two to make it unreasonably // high. $twice_avail_memory = (ini_get('memory_limit') * 2) . 'MB'; $this->assertFalse(drupal_check_memory_limit($twice_avail_memory), 'drupal_check_memory_limit() returns FALSE for twice the available memory limit.'); + // The function should always return true if the memory limit is set to -1. $this->assertTrue(drupal_check_memory_limit($twice_avail_memory, -1), 'drupal_check_memory_limit() returns TRUE when a limit of -1 (none) is supplied'); + // Test that even though we have 30MB of memory available - the function // returns FALSE when given an upper limit for how much memory can be used. $this->assertFalse(drupal_check_memory_limit('30MB', '16MB'), 'drupal_check_memory_limit() returns FALSE with a 16MB upper limit on a 30MB requirement.');