RequireOnceItopFile('core/config.class.inc.php'); $sPath = $DatamodelsPath.'/*/module.*.php'; $aPhpFiles = glob($sPath); $sExpectedVersion = ITOP_CORE_VERSION; $aModuleWithError = []; foreach ($aPhpFiles as $sPhpFile) { $sActualVersion = $this->GetItopModuleVersion($sPhpFile); $this->assertSame($sExpectedVersion, $sActualVersion, 'Module desc file does not contain the same version as the core: '.$sPhpFile); } self::assertEquals([], $aModuleWithError, 'Some modules have wrong versions ! They should match '.$sExpectedVersion); } /** * @dataProvider ItopWikiVersionProvider * @since 2.7.7 3.0.1 3.1.1 N°4714 new ITOP_CORE_VERSION constant */ public function testItopWikiVersion($sItopVersion, $sExpectedWikiVersion) { try { $sActualWikiVersion = utils::GetItopVersionWikiSyntax($sItopVersion); } catch (ApplicationException $e) { self::fail('Cannot get wiki version : '.$e->getMessage()); } self::assertSame($sExpectedWikiVersion, $sActualWikiVersion, 'Computed wiki version is wrong !'); } public function ItopWikiVersionProvider() { return [ ['2.7.0', '2_7_0'], ['2.7.7', '2_7_0'], ['3.0.0', '3_0_0'], ['3.0.1', '3_0_0'], ['3.1.0', '3_1_0'], ['3.1.1', '3_1_0'], ]; } }