Révision ecd39969
Ajouté par Assos Assos il y a environ 5 ans
drupal7/modules/simpletest/tests/bootstrap.test | ||
---|---|---|
729 | 729 |
* Tests that the drupal_check_memory_limit() function works as expected. |
730 | 730 |
*/ |
731 | 731 |
function testCheckMemoryLimit() { |
732 |
$memory_limit = ini_get('memory_limit'); |
|
733 | 732 |
// Test that a very reasonable amount of memory is available. |
734 | 733 |
$this->assertTrue(drupal_check_memory_limit('30MB'), '30MB of memory tested available.'); |
735 | 734 |
|
736 |
// Get the available memory and multiply it by two to make it unreasonably |
|
737 |
// high. |
|
738 |
$twice_avail_memory = ($memory_limit * 2) . 'MB'; |
|
739 |
|
|
735 |
// Test an unlimited memory limit. |
|
740 | 736 |
// The function should always return true if the memory limit is set to -1. |
741 |
$this->assertTrue(drupal_check_memory_limit($twice_avail_memory, -1), 'drupal_check_memory_limit() returns TRUE when a limit of -1 (none) is supplied');
|
|
737 |
$this->assertTrue(drupal_check_memory_limit('9999999999YB', -1), 'drupal_check_memory_limit() returns TRUE when a limit of -1 (none) is supplied');
|
|
742 | 738 |
|
743 | 739 |
// Test that even though we have 30MB of memory available - the function |
744 | 740 |
// returns FALSE when given an upper limit for how much memory can be used. |
Formats disponibles : Unified diff
Udpate to 7.65