From 2806a76c1d82798da8254952d8f5965699ead208 Mon Sep 17 00:00:00 2001 From: bruno-ds Date: Mon, 31 Aug 2020 14:47:55 +0200 Subject: [PATCH] :greenheart: test readability --- test/integration/iTopModulesPhpVersionChecklistTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/iTopModulesPhpVersionChecklistTest.php b/test/integration/iTopModulesPhpVersionChecklistTest.php index b36022444..c71316265 100644 --- a/test/integration/iTopModulesPhpVersionChecklistTest.php +++ b/test/integration/iTopModulesPhpVersionChecklistTest.php @@ -57,7 +57,8 @@ class iTopModulesPhpVersionIntegrationTest extends ItopTestCase $matches ); - $this->assertSame($sExpectedVersion, $matches[1], "$sPhpFile file refer does not refer to current itop version ($matches[1] instead of expected $sExpectedVersion)"); + $this->assertRegExp("#$sExpectedVersion#", $matches[1], "$sPhpFile file refer does not refer to current itop version ($sModuleName/$matches[1] does not match regexp $sModuleName/$sExpectedVersion)"); + } public function iTopModulesPhpVersionProvider() @@ -83,7 +84,7 @@ class iTopModulesPhpVersionIntegrationTest extends ItopTestCase $sPath = $DatamodelsPath.'/*/module.*.php'; $aPhpFiles = glob($sPath); - $sExpectedVersion = \utils::GetItopPatchVersion(); + $sExpectedVersion = \utils::GetItopMinorVersion().'\.\d+'; // ie: 2.7\.\d+ (and yes, the 1st dot should be escaped, but, hey, it is good enough as it, ans less complex to read) $aTestCases = array(); foreach ($aPhpFiles as $sPhpFile)