-Use skipif.inc

-split into two tests
-domxml001.phpt should work
-domxml002.phpt contains the part that fails
This commit is contained in:
Marcus Boerger 2002-10-29 16:06:51 +00:00
parent 5c92a61dcb
commit 2719c54b32
2 changed files with 28 additions and 19 deletions

View file

@ -1,9 +1,7 @@
--TEST-- --TEST--
Test 1: Accessing single node Test 1: Accessing single node
--INI--
report_memleaks=0
--SKIPIF-- --SKIPIF--
<?php if(!extension_loaded("domxml")) print "skip"; ?> <?php require_once('skipif.inc'); ?>
--FILE-- --FILE--
<?php <?php
require_once("domxml_test.inc"); require_once("domxml_test.inc");
@ -15,8 +13,9 @@ if(!$dom) {
exit; exit;
} }
$children = $dom->children(); // children() of of document would result in a memleak
print_node_list($children); //$children = $dom->children();
//print_node_list($children);
echo "--------- root\n"; echo "--------- root\n";
$rootnode = $dom->root(); $rootnode = $dom->root();
@ -98,20 +97,6 @@ print ("Not needed\n");
?> ?>
--EXPECT-- --EXPECT--
Test 1: accessing single nodes from php Test 1: accessing single nodes from php
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
--------- root --------- root
Node Name: chapter Node Name: chapter
Node Type: 1 Node Type: 1

View file

@ -0,0 +1,24 @@
--TEST--
Test 2: Memleak in accessing children() of document.
--INI--
report_memleaks=0
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
require_once("domxml_test.inc");
$dom = xmldoc($xmlstr);
if(!$dom) {
die('Error while parsing the document');
}
$children = $dom->children();
print_node_list($children);
?>
--EXPECT--
--------- root
Node Name: chapter
Node Type: 1
Num Children: 4