assertSame($sExpectedVersion, $matches[1], 'Module desc file does not contain the same version as the core: '.$sPhpFile); } public function iTopModulesPhpVersionProvider() { parent::setUp(); require_once APPROOT.'core/config.class.inc.php'; require_once APPROOT.'application/utils.inc.php'; if (is_dir(APPROOT.'datamodels/2.x')) { $DatamodelsPath = APPROOT.'datamodels/2.x'; } elseif (is_dir(APPROOT.'datamodels/1.x')) { $DatamodelsPath = APPROOT.'datamodels/1.x'; } else { throw new \Exception('Cannot local the datamodels directory'); } $sPath = $DatamodelsPath.'/*/module.*.php'; $aPhpFiles = glob($sPath); $sExpectedVersion = ITOP_CORE_VERSION; $aTestCases = array(); foreach ($aPhpFiles as $sPhpFile) { $aTestCases[$sPhpFile] = array( 'sExpectedVersion' => $sExpectedVersion, 'sPhpFile' => $sPhpFile, ); } return $aTestCases; } }