function PhpRequirementsTest::testMinimumSupportedPhp
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Utility/PhpRequirementsTest.php \Drupal\Tests\Core\Utility\PhpRequirementsTest::testMinimumSupportedPhp()
- 10 core/tests/Drupal/Tests/Core/Utility/PhpRequirementsTest.php \Drupal\Tests\Core\Utility\PhpRequirementsTest::testMinimumSupportedPhp()
Tests the minimum supported PHP for valid scenarios.
@covers ::getMinimumSupportedPhp
@dataProvider providerMinimumSupportedPhp
Parameters
string $date_string: A valid PHP date string for the date to check.
string $drupal_minimum_php: The PHP minimum version hard requirement for the Drupal version, below which Drupal cannot be installed or updated, typically \Drupal::MINIMUM_PHP.
string[] $php_eol_dates: Associative array of PHP version EOL date strings, keyed by the PHP minor version.
string $expected_php_version: The PHP version the test should recommend.
File
-
core/
tests/ Drupal/ Tests/ Core/ Utility/ PhpRequirementsTest.php, line 72
Class
- PhpRequirementsTest
- Tests the \Drupal\Core\Utility\PhpRequirements class.
Namespace
Drupal\Tests\Core\UtilityCode
public function testMinimumSupportedPhp(string $date_string, string $drupal_minimum_php, array $php_eol_dates, string $expected_php_version) : void {
$reflected = new \ReflectionClass(PhpRequirements::class);
$reflected->setStaticPropertyValue('drupalMinimumPhp', $drupal_minimum_php);
$reflected->setStaticPropertyValue('phpEolDates', $php_eol_dates);
$date = new \DateTime($date_string);
$this->assertSame($expected_php_version, PhpRequirements::getMinimumSupportedPhp($date));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.