Guest User

Untitled

a guest
May 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Index: api/testing/case/functional.php
  2. ===================================================================
  3. --- api/testing/case/functional.php (revision 10921)
  4. +++ api/testing/case/functional.php (working copy)
  5. @@ -133,7 +133,19 @@
  6. protected function loadResponse() {
  7. $response = api_response::getInstance();
  8. $resp = $response->getContents();
  9. - $this->responseDom = DOMDocument::loadXML($resp);
  10. +
  11. + if (empty($resp)) {
  12. + throw new api_testing_exception("Empty response document");
  13. + }
  14. +
  15. + $dom = new DOMDocument();
  16. + if (!$dom->loadXML($resp)) {
  17. + throw new api_testing_exception(
  18. + sprintf("Unable to load XML: '%s'", $resp));
  19. + }
  20. +
  21. + $this->responseDom = $dom;
  22. }
  23.  
  24. /**
Add Comment
Please, Sign In to add comment