load($sXmlFile); $oTransformedXml = new DOMDocument(); $oTransformedXml->load($sXmlFile); $oFormat = new iTopDesignFormat($oTransformedXml); if ($oFormat->Convert()) { // Compare the original and new format $sExpectedXmlVersion = ITOP_DESIGN_LATEST_VERSION; $this->assertSame($oTransformedXml->saveXML(), $oOriginalXml->saveXML(), "Datamodel file $sXmlFile:2 not in the latest format ($sExpectedXmlVersion)"); } else { $this->fail("Failed to convert $sXmlFile into the latest format"); } } public function DatamodelItopXmlVersionProvider() { static::setUp(); $sPath = APPROOT.'datamodels/2.x/*/datamodel.*.xml'; $aXmlFiles = glob($sPath); $aXmlFiles[] = APPROOT.'core/datamodel.core.xml'; $aXmlFiles[] = APPROOT.'application/datamodel.application.xml'; $aTestCases = array(); foreach ($aXmlFiles as $sXmlFile) { $aTestCases[$sXmlFile] = array( 'sXmlFile' => $sXmlFile, ); } return $aTestCases; } }