summaryrefslogtreecommitdiffstats
path: root/tests/lib/App
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-01-26 16:35:43 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-01-26 16:35:43 +0100
commitb4f71ccf4dd43332ab92eb860604c2308cb36a9d (patch)
treeb8fbed8f6167265598707c4a301eb30e62d0574f /tests/lib/App
parent652bf9d363e891460ec5c341f05645169322ffc6 (diff)
downloadnextcloud-server-b4f71ccf4dd43332ab92eb860604c2308cb36a9d.tar.gz
nextcloud-server-b4f71ccf4dd43332ab92eb860604c2308cb36a9d.zip
Fix app fetcher php comparison to allow wider ranges
When app app specifies php 7.4 as upper limit we have to allow the installation on php>7.4.0. The previous version check didn't do that. This adjusts the regexes to discard any irrelevant suffix after the three version numbers so that we can use more fine granular checks than php's version_compare can do out of the box, like for php 7.4 we only compare the major and minor version numbers and ignore the patch level. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/App')
-rw-r--r--tests/lib/App/CompareVersionTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/App/CompareVersionTest.php b/tests/lib/App/CompareVersionTest.php
index 6db31d0ee6f..d94b6f18a0f 100644
--- a/tests/lib/App/CompareVersionTest.php
+++ b/tests/lib/App/CompareVersionTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at>
*
@@ -49,11 +51,17 @@ class CompareVersionTest extends TestCase {
['13.0.0', '13', '>=', true],
['13.0.1', '13', '>=', true],
['13.0.1', '13', '<=', true],
+ ['13.0.1.9', '13', '<=', true],
+ ['13.0.1-beta.1', '13', '<=', true],
+ ['7.4.14', '7.4', '<=', true],
+ ['7.4.14-ubuntu', '7.4', '<=', true],
+ ['7.4.14-ubuntu', '7.4.15', '<=', true],
// Incompatible major versions
['13.0.0.3', '13.0.0', '<', false],
['12.0.0', '13.0.0', '>=', false],
['12.0.0', '13.0', '>=', false],
['12.0.0', '13', '>=', false],
+ ['7.4.15-ubuntu', '7.4.15', '>=', true],
// Incompatible minor and patch versions
['13.0.0', '13.0.1', '>=', false],
['13.0.0', '13.1', '>=', false],