From e0fa64f897713d8bc8fc367ae86cbc8c265180e9 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Thu, 8 Jun 2023 12:33:48 +0200 Subject: [PATCH] fix update-check unit-tests now that the current testing version is at 2.1.0-dev1 Signed-off-by: Michael Kaufmann --- tests/Froxlor/FroxlorTest.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/Froxlor/FroxlorTest.php b/tests/Froxlor/FroxlorTest.php index 1719256dfd..0190b5e999 100644 --- a/tests/Froxlor/FroxlorTest.php +++ b/tests/Froxlor/FroxlorTest.php @@ -19,11 +19,14 @@ public function testFroxlorcheckUpdate() $json_result = Froxlor::getLocal($admin_userdata)->checkUpdate(); $result = json_decode($json_result, true)['data']; - $this->assertEquals(0, $result['isnewerversion']); - if (defined('DEV_FROXLOR') && DEV_FROXLOR == 1) { - $this->assertEquals("You already have the latest testing-version of Froxlor installed.", $result['additional_info']); - } else { - $this->assertEquals("You already have the latest version of Froxlor installed.", $result['additional_info']); + $this->assertContains($result['isnewerversion'] ?? -1, [0,1]); + $this->assertNotEmpty($result['version']); + if ($result['isnewerversion'] == 0) { + if (defined('DEV_FROXLOR') && DEV_FROXLOR == 1) { + $this->assertEquals("You already have the latest testing-version of Froxlor installed.", $result['additional_info']); + } else { + $this->assertEquals("You already have the latest version of Froxlor installed.", $result['additional_info']); + } } } }