assertSame($sExpectedVersion, $matches[1], "$sPhpFile file refer does not refer to current itop version ($matches[1] instead of expected $sExpectedVersion)"); } 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 = \utils::GetItopPatchVersion(); $aTestCases = array(); foreach ($aPhpFiles as $sPhpFile) { $aTestCases[$sPhpFile] = array( 'sExpectedVersion' => $sExpectedVersion, 'sPhpFile' => $sPhpFile, ); } return $aTestCases; } }