From: Seamus Lee Date: Wed, 16 Jun 2021 08:34:02 +0000 (+1000) Subject: [php8-compact] Allow for CiviCRM to be installed by 3rd parties using composer on... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d6e906e025b4c22d1a4a2ff49ade8f705ca81567;p=civicrm-core.git [php8-compact] Allow for CiviCRM to be installed by 3rd parties using composer on php8 systems Fix unit test --- diff --git a/composer.json b/composer.json index 6e15bd0388..5765df6b98 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ } }, "require": { - "php": "~7.2", + "php": "~7.2 || ~8", "cache/integration-tests": "~0.17.0", "dompdf/dompdf" : "~1.0.0", "firebase/php-jwt": ">=3 <6", diff --git a/composer.lock b/composer.lock index 48ef36a914..6938b626a7 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": "e7cca2de5a5b2bd54ac4c14b677845ed", + "content-hash": "806655f49ee4984e61d0c1bf7bcc0c88", "packages": [ { "name": "adrienrn/php-mimetyper", @@ -4036,7 +4036,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~7.2", + "php": "~7.2 || ~8", "ext-intl": "*", "ext-json": "*" }, diff --git a/tests/phpunit/CRM/Upgrade/FormTest.php b/tests/phpunit/CRM/Upgrade/FormTest.php index c5427e698a..d028bd82e2 100644 --- a/tests/phpunit/CRM/Upgrade/FormTest.php +++ b/tests/phpunit/CRM/Upgrade/FormTest.php @@ -18,7 +18,7 @@ class CRM_Upgrade_FormTest extends CiviUnitTestCase { $composerJsonRequirePhp = preg_replace(';[~^];', '', $composerJson['require']['php']); $actualMajorMinor = preg_replace(';^[\^]*(\d+\.\d+)\..*$;', '\1', $composerJsonRequirePhp); $expectMajorMinor = preg_replace(';^(\d+\.\d+)\..*$;', '\1', \CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER); - $this->assertEquals($expectMajorMinor, $actualMajorMinor, "The PHP version requirements in CRM_Upgrade_Form ($expectMajorMinor) and composer.json ($actualMajorMinor) should specify same major+minor versions."); + $this->assertStringContainsString($expectMajorMinor, $actualMajorMinor, "The PHP version requirements in CRM_Upgrade_Form ($expectMajorMinor) and composer.json ($actualMajorMinor) should specify same major+minor versions."); } }