Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: api/testing/case/functional.php
- ===================================================================
- --- api/testing/case/functional.php (revision 10921)
- +++ api/testing/case/functional.php (working copy)
- @@ -133,7 +133,19 @@
- protected function loadResponse() {
- $response = api_response::getInstance();
- $resp = $response->getContents();
- - $this->responseDom = DOMDocument::loadXML($resp);
- +
- + if (empty($resp)) {
- + throw new api_testing_exception("Empty response document");
- + }
- +
- + $dom = new DOMDocument();
- + if (!$dom->loadXML($resp)) {
- + throw new api_testing_exception(
- + sprintf("Unable to load XML: '%s'", $resp));
- + }
- +
- + $this->responseDom = $dom;
- }
- /**
Add Comment
Please, Sign In to add comment