From 2178b1d02d93fbfb8f018bcf151ececadbff719f Mon Sep 17 00:00:00 2001 From: Lonny Kapelushnik Date: Thu, 21 Jun 2012 23:21:17 -0400 Subject: Adding in test for feature 55218 --- ext/simplexml/tests/feature55218.phpt | 117 ++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 ext/simplexml/tests/feature55218.phpt (limited to 'ext/simplexml') diff --git a/ext/simplexml/tests/feature55218.phpt b/ext/simplexml/tests/feature55218.phpt new file mode 100644 index 0000000000..25ea534376 --- /dev/null +++ b/ext/simplexml/tests/feature55218.phpt @@ -0,0 +1,117 @@ +--TEST-- +Bug #55218 getDocNamespaces from current element and not root +--SKIPIF-- + +--FILE-- + + + + John Doe + + Susie Q. Public + + jdslkfjsldk jskdfjsmlkjfkldjkjflskj kljfslkjf sldk + +'); + +echo "getDocNamespaces\n"; +echo "\nBackwards Compatibility:\n"; +echo "recursion:\n"; + +var_dump ( $x->getDocNamespaces(true) ) ; +var_dump( $x->person[0]->getDocNamespaces(true) ); +var_dump( $x->person[1]->getDocNamespaces(true) ); + +echo "\nnon recursive:\n"; + +var_dump( $x->getDocNamespaces(false) ); +var_dump( $x->person[0]->getDocNamespaces(false) ); +var_dump( $x->person[1]->getDocNamespaces(false) ); + +echo "\n\nUsing new 'from_root' bool set to false:\n"; +echo "recursion:\n"; + +var_dump ( $x->getDocNamespaces(true, false) ) ; +var_dump( $x->person[0]->getDocNamespaces(true, false) ); +var_dump( $x->person[1]->getDocNamespaces(true, false) ); + +echo "\nnon recursive:\n"; + +var_dump( $x->getDocNamespaces(false, false) ); +var_dump( $x->person[0]->getDocNamespaces(false, false) ); +var_dump( $x->person[1]->getDocNamespaces(false, false) ); + +?> +===DONE=== +--EXPECTF-- +getDocNamespaces + +Backwards Compatibility: +recursion: +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} + +non recursive: +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} + + +Using new 'from_root' bool set to false: +recursion: +array(2) { + ["p"]=> + string(20) "http://example.org/p" + ["t"]=> + string(20) "http://example.org/t" +} +array(1) { + ["t"]=> + string(20) "http://example.org/t" +} +array(0) { +} + +non recursive: +array(1) { + ["p"]=> + string(20) "http://example.org/p" +} +array(1) { + ["t"]=> + string(20) "http://example.org/t" +} +array(0) { +} +===DONE=== \ No newline at end of file -- cgit v1.2.1