From 8de753f09e7620c97ac74e134ee1a220e73b1cff Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sun, 27 Feb 2005 23:15:52 +0000 Subject: [PATCH] - Add tests --- ext/simplexml/tests/016a.phpt | 29 +++++++++++++++++++++++++++++ ext/simplexml/tests/022.phpt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100755 ext/simplexml/tests/016a.phpt create mode 100755 ext/simplexml/tests/022.phpt diff --git a/ext/simplexml/tests/016a.phpt b/ext/simplexml/tests/016a.phpt new file mode 100755 index 0000000000..9797e29305 --- /dev/null +++ b/ext/simplexml/tests/016a.phpt @@ -0,0 +1,29 @@ +--TEST-- +SimpleXML: concatenating attributes +--SKIPIF-- + +--FILE-- + + + +EOF; + +$people = simplexml_load_string($xml); +var_dump($people->person['name']); +$people->person['name'] .= 'Bar'; +var_dump($people->person['name']); + +?> +===DONE=== +--EXPECTF-- +object(SimpleXMLElement)#%d (1) { + [0]=> + string(3) "Foo" +} +object(SimpleXMLElement)#%d (1) { + [0]=> + string(6) "FooBar" +} +===DONE=== diff --git a/ext/simplexml/tests/022.phpt b/ext/simplexml/tests/022.phpt new file mode 100755 index 0000000000..08cb908c9c --- /dev/null +++ b/ext/simplexml/tests/022.phpt @@ -0,0 +1,30 @@ +--TEST-- +SimpleXML and attributes inside foreach +--SKIPIF-- + +--FILE-- + + +EOF; + +$sxe = simplexml_load_string($xml); + +foreach($sxe->content->file as $file) +{ + var_dump($file); + var_dump($file['glob']); +} + +?> +===DONE=== +--EXPECTF-- +object(SimpleXMLElement)#%d (0) { +} +object(SimpleXMLElement)#%d (1) { + [0]=> + string(11) "slide_*.xml" +} +===DONE=== -- 2.40.0