diff --git a/test/setup/SetupUtilsTest.php b/test/setup/SetupUtilsTest.php index 51ce91e2b..6ed09161c 100644 --- a/test/setup/SetupUtilsTest.php +++ b/test/setup/SetupUtilsTest.php @@ -136,10 +136,12 @@ class SetupUtilsTest extends ItopTestCase // Ensure that not validated version is greater than min. supported version $this->assertTrue(version_compare($sPHPMinVersion, $sPHPNotValidatedVersion, '<'), "SetupUtils::PHP_MIN_VERSION ($sPHPMinVersion) is not strictly lower than SetupUtils::PHP_NOT_VALIDATED_VERSION ($sPHPNotValidatedVersion)"); - $oComposerConfig = json_decode(file_get_contents(APPROOT.'composer.json')); - // Platform/PHP must be set to the minimum to ensure dependancies are compatible with the min. version - $this->assertEquals($sPHPMinVersion, $oComposerConfig->config->platform->php, "Composer/Platform/PHP"); - // Require/PHP must be set to the supported PHP versions range in order to keep our package constraints up-to-date - $this->assertEquals(">=$sPHPMinVersion <$sPHPNotValidatedVersion", $oComposerConfig->require->php, "Composer/Require/PHP"); + if (file_exists(APPROOT.'composer.json')) { + $oComposerConfig = json_decode(file_get_contents(APPROOT.'composer.json')); + // Platform/PHP must be set to the minimum to ensure dependancies are compatible with the min. version + $this->assertEquals($sPHPMinVersion, $oComposerConfig->config->platform->php, "Composer/Platform/PHP"); + // Require/PHP must be set to the supported PHP versions range in order to keep our package constraints up-to-date + $this->assertEquals(">=$sPHPMinVersion <$sPHPNotValidatedVersion", $oComposerConfig->require->php, "Composer/Require/PHP"); + } } }