You are here

public function EnvironmentTest::testCheckMemoryLimit in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php \Drupal\Tests\Component\Utility\EnvironmentTest::testCheckMemoryLimit()
  2. 9 core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php \Drupal\Tests\Component\Utility\EnvironmentTest::testCheckMemoryLimit()

Tests \Drupal\Component\Utility\Environment::checkMemoryLimit().

@dataProvider providerTestCheckMemoryLimit @covers ::checkMemoryLimit

Parameters

string $required: The required memory argument for \Drupal\Component\Utility\Environment::checkMemoryLimit().

string $custom_memory_limit: The custom memory limit argument for \Drupal\Component\Utility\Environment::checkMemoryLimit().

bool $expected: The expected return value from \Drupal\Component\Utility\Environment::checkMemoryLimit().

File

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

Class

EnvironmentTest
Test PHP Environment helper methods.

Namespace

Drupal\Tests\Component\Utility

Code

public function testCheckMemoryLimit($required, $custom_memory_limit, $expected) {
  $actual = Environment::checkMemoryLimit($required, $custom_memory_limit);
  $this
    ->assertEquals($expected, $actual);
}