From 078bcec0997ad0e07b720c43cc9e6d0e046a75ab Mon Sep 17 00:00:00 2001 From: SVN Migration Date: Thu, 27 Feb 2003 17:43:39 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'PHP_5'. --- ext/domxml/tests/domxml001.phpt | 273 --------------------------------------- ext/domxml/tests/domxml002.phpt | 31 ----- ext/domxml/tests/domxml_test.inc | 42 ------ ext/domxml/tests/skipif.inc | 3 - ext/domxml/tests/xmldoc.phpt | 35 ----- 5 files changed, 384 deletions(-) delete mode 100644 ext/domxml/tests/domxml001.phpt delete mode 100644 ext/domxml/tests/domxml002.phpt delete mode 100644 ext/domxml/tests/domxml_test.inc delete mode 100644 ext/domxml/tests/skipif.inc delete mode 100644 ext/domxml/tests/xmldoc.phpt (limited to 'ext/domxml/tests') diff --git a/ext/domxml/tests/domxml001.phpt b/ext/domxml/tests/domxml001.phpt deleted file mode 100644 index b4d27c796e..0000000000 --- a/ext/domxml/tests/domxml001.phpt +++ /dev/null @@ -1,273 +0,0 @@ ---TEST-- -Test 1: Accessing single node ---SKIPIF-- - ---FILE-- -children(); -//print_node_list($children); - -echo "--------- root\n"; -$rootnode = $dom->root(); -print_node($rootnode); - -echo "--------- children of root\n"; -$children = $rootnode->children(); -print_node_list($children); - -// The last node should be identical with the last entry in the children array -echo "--------- last\n"; -$last = $rootnode->last_child(); -print_node($last); - -// The parent of this last node is the root again -echo "--------- parent\n"; -$parent = $last->parent(); -print_node($parent); - -// The children of this parent are the same children as one above -echo "--------- children of parent\n"; -$children = $parent->children(); -print_node_list($children); - -echo "--------- creating a new attribute\n"; -//This is worthless -//$attr = $dom->create_attribute("src", "picture.gif"); -//print_r($attr); - -//$rootnode->set_attribute_node($attr); /* Not implemented */ -$attr = $rootnode->set_attribute("src", "picture.gif"); -$attr = $rootnode->get_attribute("src"); -print_r($attr); -print "\n"; - -echo "--------- Get Attribute Node\n"; -$attr = $rootnode->get_attribute_node("src"); -print_node($attr); - -echo "--------- Remove Attribute Node\n"; -$attr = $rootnode->remove_attribute("src"); -print "Removed " . $attr . " attributes.\n"; - -echo "--------- attributes of rootnode\n"; -$attrs = $rootnode->attributes(); -print_node_list($attrs); - -echo "--------- children of an attribute\n"; -$children = $attrs[0]->children(); -print_node_list($children); - -echo "--------- Add child to root\n"; -$newchild = $rootnode->new_child("Silly", "Symphony"); -print_node($newchild); -print $dom->dumpmem(); -print "\n"; - -echo "--------- Find element by tagname\n"; -echo " Using dom\n"; -$children = $dom->get_elements_by_tagname("Silly"); -print_node_list($children); -echo " Using elem\n"; -$children = $rootnode->get_elements_by_tagname("Silly"); -print_node_list($children); - -echo "--------- Unlink Node\n"; -print_node($children[0]); -//domxml_node_unlink_node($children[0]); -$children[0]->unlink_node(); -print_node_list($rootnode->children()); -print $dom->dumpmem(); - -echo "--------- Find element by id\n"; -print ("Not implemented\n"); - -echo "--------- Check various node_name return values\n"; -print ("Not needed\n"); - -?> ---EXPECT-- -Test 1: accessing single nodes from php ---------- root -Node Name: chapter -Node Type: 1 -Num Children: 4 - ---------- children of root -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- last -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- parent -Node Name: chapter -Node Type: 1 -Num Children: 4 - ---------- children of parent -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - ---------- creating a new attribute -picture.gif ---------- Get Attribute Node -Node Name: src -Node Type: 2 -Num Children: 1 -Node Content: picture.gif - ---------- Remove Attribute Node -Removed 1 attributes. ---------- attributes of rootnode -Node Name: language -Node Type: 2 -Num Children: 1 -Node Content: en - ---------- children of an attribute -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: en - ---------- Add child to root -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - -Symphony - ---------- Find element by tagname - Using dom -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - - Using elem -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - ---------- Unlink Node -Node Name: Silly -Node Type: 1 -Num Children: 1 -Node Content: Symphony - -Node Name: title -Node Type: 1 -Num Children: 1 -Node Content: Title - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - -Node Name: para -Node Type: 1 -Num Children: 7 - -Node Name: #text -Node Type: 3 -Num Children: 0 -Node Content: - - - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - ---------- Find element by id -Not implemented ---------- Check various node_name return values -Not needed diff --git a/ext/domxml/tests/domxml002.phpt b/ext/domxml/tests/domxml002.phpt deleted file mode 100644 index fa60f15e6d..0000000000 --- a/ext/domxml/tests/domxml002.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -Test 2: Memleak in accessing children() of document. ---SKIPIF-- - ---FILE-- -children(); -print_node_list($children); - -?> ---EXPECT-- -Node Name: -Node Type: 14 -Num Children: 1 -Node Content: - -Node Name: #comment -Node Type: 8 -Num Children: 0 -Node Content: lsfj - -Node Name: chapter -Node Type: 1 -Num Children: 4 diff --git a/ext/domxml/tests/domxml_test.inc b/ext/domxml/tests/domxml_test.inc deleted file mode 100644 index fa9b9e4baf..0000000000 --- a/ext/domxml/tests/domxml_test.inc +++ /dev/null @@ -1,42 +0,0 @@ - - -]> - -Title - -&sp; - - - - -a1b1c1 -a2c2 -a3b3c3 - - - - - "; - -function print_node($node) -{ - print "Node Name: " . $node->node_name(); - print "\nNode Type: " . $node->node_type(); - print "\nNum Children: " . count($node->children()); - if(count($node->children()) <= 1){ - print "\nNode Content: " . $node->get_content(); - } - print "\n\n"; -} - -function print_node_list($nodelist) -{ - foreach($nodelist as $node) - { - print_node($node); - } -} - -?> diff --git a/ext/domxml/tests/skipif.inc b/ext/domxml/tests/skipif.inc deleted file mode 100644 index 8498b5b190..0000000000 --- a/ext/domxml/tests/skipif.inc +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/ext/domxml/tests/xmldoc.phpt b/ext/domxml/tests/xmldoc.phpt deleted file mode 100644 index 244f289c16..0000000000 --- a/ext/domxml/tests/xmldoc.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -xmldoc() ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -object(domdocument)(9) { - ["name"]=> - string(9) "#document" - ["url"]=> - string(0) "" - ["version"]=> - string(3) "1.0" - ["standalone"]=> - int(1) - ["type"]=> - int(9) - ["compression"]=> - int(-1) - ["charset"]=> - int(1) - [0]=> - int(5) - [1]=> - int(%d) -} \ No newline at end of file -- cgit v1.2.1