public function test_round_trip_xml_to_dom_and_back()
 {
     $orig = '<foo>bar</foo>';
     $dom = XmlParser::domParser($orig);
     $after = XmlParser::getDomDocumentAsString($dom);
     $cleanedUp = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', $after);
     $cleanedUp = str_replace("\n", '', $cleanedUp);
     $this->assertEquals($orig, $cleanedUp);
 }
Пример #2
0
 /**
  * Parses the response XML as a DomDocument.
  *
  * This method wraps the XmlParser static call in the SDK.
  *
  * @param string $xml
  *   The XML, usually from a response.
  *
  * @return DOMDocument
  *   The response XML loaded in as a DomDocument.
  */
 public function domParser($xml)
 {
     return \litle\sdk\XmlParser::domParser($xml);
 }