/** * * Returns all the failures as XML formatted string * @throws Exception */ public static function toXML(KalturaTestProcedureFailure $testProcedureFailure, $rootNodeName = 'data') { if (count($testProcedureFailure->getTestCaseInstanceFailures()) == 0) { return ""; } $dom = new DOMDocument("1.0"); //Create elements in the Dom referencing the entire test data file $testProcedureElement = $dom->createElement($rootNodeName); $testProcedureElement->setAttribute("testProcedureName", $testProcedureFailure->getTestProcedureName()); $dom->appendChild($testProcedureElement); //For each unit test data foreach ($testProcedureFailure->getTestCaseInstanceFailures() as $testCaseInstanceFailure) { //Create the xml from the object $objectAsDOM = KalturaTestCaseInstanceFailure::toXml($testCaseInstanceFailure, "TestCaseInstance"); kXml::appendDomToElement($objectAsDOM, $testProcedureElement, $dom); } return $dom; }