Commit fb8e5fff authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Thomas Löffler
Browse files

Add another test case and fix typos

parent 8bfc5c08
Pipeline #9909 failed with stages
in 3 minutes and 5 seconds
......@@ -82,7 +82,7 @@ class VersionUtility
// Assume all LTS versions are supported
if ($versionRange === '*') {
$compatibleTypo3Versions = self::getAllLtsVersionAsMajorNumber();
$compatibleTypo3Versions = self::getAllLtsVersionsAsMajor();
continue;
}
......@@ -99,7 +99,7 @@ class VersionUtility
continue;
}
if ($max === '0' || $max === '0.0.0') {
// Assume that all LTS versions between the minimal and the latest are compatible.
// Assume that all LTS versions between the minimal and the latest LTS are compatible.
$compatibleTypo3Versions = self::getVersionRange($min);
// Also break the foreach as all information was gathered.
break;
......@@ -133,7 +133,7 @@ class VersionUtility
*
* @return array
*/
protected static function getAllLtsVersionAsMajorNumber(): array
protected static function getAllLtsVersionsAsMajor(): array
{
$ltsVersions = GeneralUtility::makeInstance(LTSVersionService::class)->getAllLTSVersions();
asort($ltsVersions, SORT_NUMERIC);
......@@ -152,7 +152,7 @@ class VersionUtility
*/
protected static function getVersionRange(int $min, int $max = null): array
{
$allLtsVersions = self::getAllLtsVersionAsMajorNumber();
$allLtsVersions = self::getAllLtsVersionsAsMajor();
$max = (int)($max ?? end($allLtsVersions) ?: 0);
if ($max <= 0) {
......
......@@ -74,6 +74,16 @@ class VersionUtilityTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
],
''
];
yield 'Invalid range given - not specially checked' => [
[
[
'kind' => 'depends',
'extensionKey' => 'typo3',
'versionRange' => 'foobar'
]
],
''
];
yield 'CMS wildcard' => [
[
[
......@@ -124,7 +134,7 @@ class VersionUtilityTest extends \Nimut\TestingFramework\TestCase\UnitTestCase
],
'8'
];
yield 'Version "5" is omit on range' => [
yield 'Version "5" is omitted in range' => [
[
[
'kind' => 'depends',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment