DOMDocument_createProcessingInstruction_error.phpt 575 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. DomDocument::createProcessingInstruction() - error test for DomDocument::createProcessingInstruction()
  3. --CREDITS--
  4. Muhammad Khalid Adnan
  5. # TestFest 2008
  6. --SKIPIF--
  7. <?php require_once('skipif.inc'); ?>
  8. --FILE--
  9. <?php
  10. $doc = new DOMDocument;
  11. $node = $doc->createElement("para");
  12. $newnode = $doc->appendChild($node);
  13. try {
  14. $test_proc_inst =
  15. $doc->createProcessingInstruction( "bla bla bla" );
  16. $node->appendChild($test_proc_inst);
  17. echo $doc->saveXML();
  18. }
  19. catch (DOMException $e)
  20. {
  21. echo 'Test failed!', PHP_EOL;
  22. }
  23. ?>
  24. --EXPECT--
  25. Test failed!