DOMDocument_createAttribute_basic.phpt 455 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. DomDocument::createAttribute() - basic test for DomDocument::createAttribute()
  3. --CREDITS--
  4. Muhammad Khalid Adnan
  5. # TestFest 2008
  6. --EXTENSIONS--
  7. dom
  8. --FILE--
  9. <?php
  10. $doc = new DOMDocument;
  11. $node = $doc->createElement("para");
  12. $newnode = $doc->appendChild($node);
  13. // A pass case.
  14. $test_attribute = $doc->createAttribute("hahaha");
  15. $node->appendChild($test_attribute);
  16. echo $doc->saveXML();
  17. ?>
  18. --EXPECT--
  19. <?xml version="1.0"?>
  20. <para hahaha=""/>