DOMNode_C14NFile_basic.phpt 735 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. DOMNode::C14NFile()
  3. --SKIPIF--
  4. <?php
  5. include('skipif.inc');
  6. ?>
  7. --FILE--
  8. <?php
  9. $xml = <<< XML
  10. <?xml version="1.0" ?>
  11. <books>
  12. <book>
  13. <title>The Grapes of Wrath</title>
  14. <author>John Steinbeck</author>
  15. </book>
  16. <book>
  17. <title>The Pearl</title>
  18. <author>John Steinbeck</author>
  19. </book>
  20. </books>
  21. XML;
  22. $output = dirname(__FILE__).'/DOMNode_C14NFile_basic.tmp';
  23. $doc = new DOMDocument();
  24. $doc->loadXML($xml);
  25. $node = $doc->getElementsByTagName('title')->item(0);
  26. var_dump($node->C14NFile($output));
  27. $content = file_get_contents($output);
  28. var_dump($content);
  29. ?>
  30. --CLEAN--
  31. <?php
  32. $output = dirname(__FILE__).'/DOMNode_C14NFile_basic.tmp';
  33. unlink($output);
  34. ?>
  35. --EXPECTF--
  36. int(34)
  37. string(34) "<title>The Grapes of Wrath</title>"