assertEquals($expected, $actual); } /** * Provides data for testCheckMemoryLimit(). * * @return array * An array of arrays, each containing the arguments for * \Drupal\Component\Utility\Environment::checkMemoryLimit(): * required and memory_limit, and the expected return value. */ public function providerTestCheckMemoryLimit() { $memory_limit = ini_get('memory_limit'); $twice_avail_memory = ($memory_limit * 2) . 'MB'; return [ // Minimal amount of memory should be available. ['30MB', NULL, TRUE], // Exceed a custom (unlimited) memory limit. [$twice_avail_memory, -1, TRUE], // Exceed a custom memory limit. ['30MB', '16MB', FALSE], // Available = required. ['30MB', '30MB', TRUE], ]; } }