diff options
author | Marcus Boerger <helly@php.net> | 2003-11-23 16:22:11 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-11-23 16:22:11 +0000 |
commit | a7a9ec079a3f463299629c15e38432c9049d159e (patch) | |
tree | b0b04af9025b90f633b61af74d2120bba4f9b09c /ext/simplexml/tests/010.phpt | |
parent | fc117add30f5d3808bb9afbe219204d16e586ea0 (diff) | |
download | php-git-a7a9ec079a3f463299629c15e38432c9049d159e.tar.gz |
Add new test
Diffstat (limited to 'ext/simplexml/tests/010.phpt')
-rw-r--r-- | ext/simplexml/tests/010.phpt | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/ext/simplexml/tests/010.phpt b/ext/simplexml/tests/010.phpt new file mode 100644 index 0000000000..01ad49d064 --- /dev/null +++ b/ext/simplexml/tests/010.phpt @@ -0,0 +1,51 @@ +--TEST-- +SimpleXML and recursion +--SKIPIF-- +<?php + if (!extension_loaded('simplexml')) print 'skip'; + if (!class_exists('RecursiveIteratorIterator')) print 'skip RecursiveIteratorIterator not available'; +?> +--FILE-- +<?php + +$sxe = simplexml_load_file(dirname(__FILE__).'/006.xml'); + +foreach(new RecursiveIteratorIterator($sxe, 1) as $name => $data) { + var_dump($name); + var_dump(get_class($data)); + var_dump(trim($data)); +} + +echo "===DUMP===\n"; + +var_dump(get_class($sxe)); +var_dump(trim($sxe->elem1)); + +?> +===DONE=== +--EXPECT-- +string(5) "elem1" +string(17) "simplexml_element" +string(10) "Bla bla 1." +string(7) "comment" +string(17) "simplexml_element" +string(0) "" +string(5) "elem2" +string(17) "simplexml_element" +string(28) "Here we have some text data." +string(5) "elem3" +string(17) "simplexml_element" +string(19) "And here some more." +string(5) "elem4" +string(17) "simplexml_element" +string(15) "Wow once again." +string(6) "elem11" +string(17) "simplexml_element" +string(10) "Bla bla 2." +string(7) "elem111" +string(17) "simplexml_element" +string(7) "Foo Bar" +===DUMP=== +string(17) "simplexml_element" +string(10) "Bla bla 1." +===DONE=== |