You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
820 B

  1. --TEST--
  2. DOMText::appendData basic functionality test
  3. --CREDITS--
  4. Mike Sullivan <mike@regexia.com>
  5. #TestFest 2008 (London)
  6. --FILE--
  7. <?php
  8. $document = new DOMDocument;
  9. $root = $document->createElement('root');
  10. $document->appendChild($root);
  11. $text = $document->createElement('text');
  12. $root->appendChild($text);
  13. $textnode = $document->createTextNode('');
  14. $text->appendChild($textnode);
  15. $textnode->appendData('data');
  16. echo "Text Length (one append): " . $textnode->length . "\n";
  17. $textnode->appendData('><&"');
  18. echo "Text Length (two appends): " . $textnode->length . "\n";
  19. echo "Text Content: " . $textnode->data . "\n";
  20. echo "\n" . $document->saveXML();
  21. ?>
  22. --EXPECT--
  23. Text Length (one append): 4
  24. Text Length (two appends): 8
  25. Text Content: data><&"
  26. <?xml version="1.0"?>
  27. <root><text>data&gt;&lt;&amp;"</text></root>