mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
✅ Fix tests on packages missing composer.json file
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user