comparison core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
42 * An array of arrays, each containing the arguments for 42 * An array of arrays, each containing the arguments for
43 * \Drupal\Component\Utility\Environment::checkMemoryLimit(): 43 * \Drupal\Component\Utility\Environment::checkMemoryLimit():
44 * required and memory_limit, and the expected return value. 44 * required and memory_limit, and the expected return value.
45 */ 45 */
46 public function providerTestCheckMemoryLimit() { 46 public function providerTestCheckMemoryLimit() {
47 $memory_limit = ini_get('memory_limit');
48 $twice_avail_memory = ($memory_limit * 2) . 'MB';
49
50 return [ 47 return [
51 // Minimal amount of memory should be available. 48 // Minimal amount of memory should be available.
52 ['30MB', NULL, TRUE], 49 ['30MB', NULL, TRUE],
53 // Exceed a custom (unlimited) memory limit. 50 // Test an unlimited memory limit.
54 [$twice_avail_memory, -1, TRUE], 51 ['9999999999YB', -1, TRUE],
55 // Exceed a custom memory limit. 52 // Exceed a custom memory limit.
56 ['30MB', '16MB', FALSE], 53 ['30MB', '16MB', FALSE],
57 // Available = required. 54 // Available = required.
58 ['30MB', '30MB', TRUE], 55 ['30MB', '30MB', TRUE],
59 ]; 56 ];