diff --git a/composer.json b/composer.json index 72285e32c21..12508828a1f 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,10 @@ "prefer-stable": true, "config": { "preferred-install": "dist", - "autoloader-suffix": "Drupal9" + "autoloader-suffix": "Drupal9", + "platform": { + "php": "7.3.0" + } }, "extra": { "_readme": [ diff --git a/composer.lock b/composer.lock index d8243e6a026..45c05a39c3a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "460aef4d3073d9f5e8e6a2dae54468d6", + "content-hash": "54a8c91f9d19473abf71ea242e3138d9", "packages": [ { "name": "asm89/stack-cors", @@ -528,7 +528,7 @@ "dist": { "type": "path", "url": "core", - "reference": "af5b9453adf15c6831b1f73e322f8c59da877f14" + "reference": "4659974dafc65cf2e9fbe00c8be0ccd0ef0aadba" }, "require": { "asm89/stack-cors": "^1.1", @@ -554,7 +554,7 @@ "laminas/laminas-feed": "^2.12", "masterminds/html5": "^2.1", "pear/archive_tar": "^1.4.9", - "php": ">=7.3", + "php": ">=7.3.0", "psr/log": "^1.0", "stack/builder": "^1.0", "symfony-cmf/routing": "^2.1", @@ -7699,5 +7699,8 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], + "platform-overrides": { + "php": "7.3.0" + }, "plugin-api-version": "2.0.0" } diff --git a/core/composer.json b/core/composer.json index 671a37e8d66..eea29f6acf3 100644 --- a/core/composer.json +++ b/core/composer.json @@ -17,7 +17,7 @@ "ext-SPL": "*", "ext-tokenizer": "*", "ext-xml": "*", - "php": ">=7.3", + "php": ">=7.3.0", "symfony/console": "^4.4", "symfony/dependency-injection": "^4.4", "symfony/event-dispatcher": "^4.4", diff --git a/core/tests/Drupal/Tests/Composer/ComposerTest.php b/core/tests/Drupal/Tests/Composer/ComposerTest.php index 2e1d1bdfaba..0eb4e227cdb 100644 --- a/core/tests/Drupal/Tests/Composer/ComposerTest.php +++ b/core/tests/Drupal/Tests/Composer/ComposerTest.php @@ -25,4 +25,17 @@ class ComposerTest extends UnitTestCase { } } + /** + * Ensure that the configured php version matches the minimum php version. + * + * Also ensure that the minimum php version in the root-level composer.json + * file exactly matches DRUPAL_MINIMUM_PHP. + */ + public function testEnsurePhpConfiguredVersion() { + $composer_json = json_decode(file_get_contents($this->root . '/composer.json'), TRUE); + $composer_core_json = json_decode(file_get_contents($this->root . '/core/composer.json'), TRUE); + $this->assertEquals(DRUPAL_MINIMUM_PHP, $composer_json['config']['platform']['php'], 'The DRUPAL_MINIMUM_PHP constant should always be exactly the same as the config.platform.php in the root composer.json.'); + $this->assertEquals($composer_core_json['require']['php'], '>=' . $composer_json['config']['platform']['php'], 'The config.platform.php configured version in the root composer.json file should always be exactly the same as the minimum php version configured in core/composer.json.'); + } + }