Guest User

Untitled

a guest
May 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 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. +
  22. + $this->responseDom = $dom;
  23. }
  24.  
  25. /**
Add Comment
Please, Sign In to add comment