DOMDocument_loadXML_variation4.phpt 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Test DOMDocument::loadXML() with LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT, LIBXML_NOBLANKS
  3. --DESCRIPTION--
  4. This test verifies the right behaviour of the following constants:
  5. LIBXML_DTDATTR, LIBXML_NOCDATA, LIBXML_NOENT and LIBXML_NOBLANKS
  6. Environment variables used in the test:
  7. - XML_FILE: the xml file to load
  8. - LOAD_OPTIONS: the second parameter to pass to the method
  9. - EXPECTED_RESULT: the expected result
  10. --CREDITS--
  11. Antonio Diaz Ruiz <dejalatele@gmail.com>
  12. --INI--
  13. assert.bail=true
  14. --EXTENSIONS--
  15. dom
  16. --ENV--
  17. XML_FILE=/book_with_dtd2.xml
  18. LOAD_OPTIONS=LIBXML_DTDATTR|LIBXML_NOCDATA|LIBXML_NOENT|LIBXML_NOBLANKS
  19. EXPECTED_RESULT=1
  20. --FILE_EXTERNAL--
  21. domdocumentloadxml_test_method_savexml.inc
  22. --EXPECT--
  23. <?xml version="1.0" encoding="UTF-8"?>
  24. <!DOCTYPE books [
  25. <!ENTITY entitest "entity is only for test purposes">
  26. <!ATTLIST title default CDATA "default title">
  27. <!ELEMENT books (book)*>
  28. <!ELEMENT book (title , author)>
  29. <!ELEMENT title (#PCDATA)>
  30. <!ELEMENT author (#PCDATA)>
  31. ]>
  32. <books><book><title default="default title">The Grapes of Wrath</title><author>John Steinbeck</author></book><book><title default="default title">The Pearl</title><author>John Steinbeck</author></book><book><title default="default title">entity is only for test purposes</title><author>data for test</author></book></books>