bug76777.phpt 769 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. Bug #76777 (first parameter of libxml_set_external_entity_loader callback undefined)
  3. --EXTENSIONS--
  4. libxml
  5. dom
  6. --SKIPIF--
  7. <?php
  8. if (getenv("SKIP_ONLINE_TESTS")) die('skip online test');
  9. ?>
  10. --FILE--
  11. <?php
  12. $xml=<<<EOF
  13. <?xml version="1.0"?>
  14. <test/>
  15. EOF;
  16. $xsd=<<<EOF
  17. <?xml version="1.0"?>
  18. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  19. <xs:include schemaLocation="nonexistent.xsd"/>
  20. <xs:element name="test"/>
  21. </xs:schema>
  22. EOF;
  23. libxml_set_external_entity_loader(function($p,$s,$c) {
  24. var_dump($p,$s,$c);
  25. die();
  26. });
  27. $dom=new DOMDocument($xml);
  28. $dom->schemaValidateSource($xsd);
  29. ?>
  30. --EXPECT--
  31. NULL
  32. string(15) "nonexistent.xsd"
  33. array(4) {
  34. ["directory"]=>
  35. NULL
  36. ["intSubName"]=>
  37. NULL
  38. ["extSubURI"]=>
  39. NULL
  40. ["extSubSystem"]=>
  41. NULL
  42. }