/', $sFileContent, $matches ); $this->assertSame($sExpectedXmlVersion, $matches[1], "$sXmlFile file refer does not refer to current itop version ($matches[1] instead of expected $sExpectedXmlVersion)"); } public function DatamodelItopXmlVersionProvider() { parent::setUp(); require_once APPROOT.'core/config.class.inc.php'; require_once APPROOT.'application/utils.inc.php'; $sPath = APPROOT.'datamodels/2.x/*/datamodel.*.xml'; $aXmlFiles = glob($sPath); $sItopVersionShort = \utils::GetItopPatchVersion(); $aItopVersion = explode('.', $sItopVersionShort); $sExpectedXmlVersion = ($aItopVersion[0] - 1).'.'.($aItopVersion[1]); // eg: 2.7.0-dev become 1.7 $aTestCases = array(); foreach ($aXmlFiles as $sXmlFile) { $aTestCases[$sXmlFile] = array( 'sExpectedXmlVersion' => $sExpectedXmlVersion, 'sXmlFile' => $sXmlFile, ); } return $aTestCases; } }