function EnvironmentTest::providerTestCheckMemoryLimit

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php \Drupal\Tests\Component\Utility\EnvironmentTest::providerTestCheckMemoryLimit()
  2. 10 core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php \Drupal\Tests\Component\Utility\EnvironmentTest::providerTestCheckMemoryLimit()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php \Drupal\Tests\Component\Utility\EnvironmentTest::providerTestCheckMemoryLimit()

Provides data for testCheckMemoryLimit().

Return value

array An array of arrays, each containing the arguments for \Drupal\Component\Utility\Environment::checkMemoryLimit(): required and memory_limit, and the expected return value.

File

core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php, line 46

Class

EnvironmentTest
Test PHP Environment helper methods.

Namespace

Drupal\Tests\Component\Utility

Code

public function providerTestCheckMemoryLimit() {
    return [
        // Minimal amount of memory should be available.
[
            '30MB',
            NULL,
            TRUE,
        ],
        // Test an unlimited memory limit.
[
            '9999999999YB',
            -1,
            TRUE,
        ],
        // Exceed a custom memory limit.
[
            '30MB',
            '16MB',
            FALSE,
        ],
        // Available = required.
[
            '30MB',
            '30MB',
            TRUE,
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.