jmessa Wed May 21 15:04:13 2008 UTC Modified files: /php-src/ext/dom/tests DOMComment_appendData_basic_Sullivan.phpt DOMNode_issamenode_basic.phpt DOMText_appendData_basic.phpt DOMCharacterData_appendData_basic.phpt Log: - Committing tests reviewed after London TestFest 08 - Credits to: Mike Sullivan and James Lewis http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt diff -u /dev/null php-src/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt:1.2 --- /dev/null Wed May 21 15:04:13 2008 +++ php-src/ext/dom/tests/DOMComment_appendData_basic_Sullivan.phpt Wed May 21 15:04:13 2008 @@ -0,0 +1,36 @@ +--TEST-- +DOMComment::appendData basic functionality test +--CREDITS-- +Mike Sullivan <[EMAIL PROTECTED]> +#TestFest 2008 (London) +--SKIPIF-- +--FILE-- +<?php + +$document = new DOMDocument; +$root = $document->createElement('root'); +$document->appendChild($root); + +$comment = $document->createElement('comment'); +$root->appendChild($comment); + +$commentnode = $document->createComment(''); +$comment->appendChild($commentnode); +$commentnode->appendData('data'); +echo "Comment Length (one append): " . $commentnode->length . "\n"; + +$commentnode->appendData('><&"'); +echo "Comment Length (two appends): " . $commentnode->length . "\n"; + +echo "Comment Content: " . $commentnode->data . "\n"; + +echo "\n" . $document->saveXML(); + +?> +--EXPECT-- +Comment Length (one append): 4 +Comment Length (two appends): 8 +Comment Content: data><&" + +<?xml version="1.0"?> +<root><comment><!--data><&"--></comment></root> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMNode_issamenode_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/dom/tests/DOMNode_issamenode_basic.phpt diff -u /dev/null php-src/ext/dom/tests/DOMNode_issamenode_basic.phpt:1.2 --- /dev/null Wed May 21 15:04:13 2008 +++ php-src/ext/dom/tests/DOMNode_issamenode_basic.phpt Wed May 21 15:04:13 2008 @@ -0,0 +1,33 @@ +--TEST-- +DOMNode: isSameNode() +--CREDITS-- +James Lewis <[EMAIL PROTECTED]> +#TestFest 2008 +--FILE-- +<?php +require_once("dom_test.inc"); + +$dom = new DOMDocument; +$dom->loadXML($xmlstr); +if(!$dom) { + echo "Error while parsing the document\n"; + exit; +} + +$node = $dom->documentElement; +if($node->isSameNode($node)) + echo "EXPECTING SAME NODE, PASSED\n" ; +else + echo "EXPECTING SAME NODE, FAILED\n" ; + +$nodelist=$dom->getElementsByTagName('tbody') ; + +if($nodelist->item(0)->isSameNode($node)) + echo "EXPECTING NOT SAME NODE, FAILED\n" ; +else + echo "EXPECTING NOT SAME NODE, PASSED\n" ; + +?> +--EXPECT-- +EXPECTING SAME NODE, PASSED +EXPECTING NOT SAME NODE, PASSED http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMText_appendData_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/dom/tests/DOMText_appendData_basic.phpt diff -u /dev/null php-src/ext/dom/tests/DOMText_appendData_basic.phpt:1.2 --- /dev/null Wed May 21 15:04:13 2008 +++ php-src/ext/dom/tests/DOMText_appendData_basic.phpt Wed May 21 15:04:13 2008 @@ -0,0 +1,35 @@ +--TEST-- +DOMText::appendData basic functionality test +--CREDITS-- +Mike Sullivan <[EMAIL PROTECTED]> +#TestFest 2008 (London) +--FILE-- +<?php + +$document = new DOMDocument; +$root = $document->createElement('root'); +$document->appendChild($root); + +$text = $document->createElement('text'); +$root->appendChild($text); + +$textnode = $document->createTextNode(''); +$text->appendChild($textnode); +$textnode->appendData('data'); +echo "Text Length (one append): " . $textnode->length . "\n"; + +$textnode->appendData('><&"'); +echo "Text Length (two appends): " . $textnode->length . "\n"; + +echo "Text Content: " . $textnode->data . "\n"; + +echo "\n" . $document->saveXML(); + +?> +--EXPECT-- +Text Length (one append): 4 +Text Length (two appends): 8 +Text Content: data><&" + +<?xml version="1.0"?> +<root><text>data><&"</text></root> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/DOMCharacterData_appendData_basic.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/dom/tests/DOMCharacterData_appendData_basic.phpt diff -u /dev/null php-src/ext/dom/tests/DOMCharacterData_appendData_basic.phpt:1.2 --- /dev/null Wed May 21 15:04:13 2008 +++ php-src/ext/dom/tests/DOMCharacterData_appendData_basic.phpt Wed May 21 15:04:13 2008 @@ -0,0 +1,35 @@ +--TEST-- +DOMCharacterData::appendData basic functionality test +--CREDITS-- +Mike Sullivan <[EMAIL PROTECTED]> +#TestFest 2008 (London) +--FILE-- +<?php + +$document = new DOMDocument; +$root = $document->createElement('root'); +$document->appendChild($root); + +$cdata = $document->createElement('cdata'); +$root->appendChild($cdata); + +$cdatanode = $document->createCDATASection(''); +$cdata->appendChild($cdatanode); +$cdatanode->appendData('data'); +echo "CDATA Length (one append): " . $cdatanode->length . "\n"; + +$cdatanode->appendData('><&"'); +echo "CDATA Length (two appends): " . $cdatanode->length . "\n"; + +echo "CDATA Content: " . $cdatanode->data . "\n"; + +echo "\n" . $document->saveXML(); + +?> +--EXPECT-- +CDATA Length (one append): 4 +CDATA Length (two appends): 8 +CDATA Content: data><&" + +<?xml version="1.0"?> +<root><cdata><![CDATA[data><&"]]></cdata></root> \ No newline at end of file
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php