From d39dae95f79a67959e4023126e09f047caae2c10 Mon Sep 17 00:00:00 2001 From: Zoe Slattery Date: Thu, 2 Oct 2008 20:07:15 +0000 Subject: [PATCH] Committting tests for Olafur Waage --- .../SimpleXMLElement_addAttribute_basic.phpt | 21 ++++++++++++ ext/simplexml/tests/simplexml_load_file.phpt | 32 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt create mode 100644 ext/simplexml/tests/simplexml_load_file.phpt diff --git a/ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt b/ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt new file mode 100644 index 0000000000..521a81e101 --- /dev/null +++ b/ext/simplexml/tests/SimpleXMLElement_addAttribute_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +SimpleXMLElement->addAttribute() +--SKIPIF-- + +--FILE-- +addAttribute('type','novels'); + + var_dump($simple->attributes()); + echo "Done"; +?> +--EXPECTF-- +object(SimpleXMLElement)#2 (1) { + [u"@attributes"]=> + array(1) { + [u"type"]=> + unicode(6) "novels" + } +} +Done diff --git a/ext/simplexml/tests/simplexml_load_file.phpt b/ext/simplexml/tests/simplexml_load_file.phpt new file mode 100644 index 0000000000..2eb8548e9e --- /dev/null +++ b/ext/simplexml/tests/simplexml_load_file.phpt @@ -0,0 +1,32 @@ +--TEST-- +simplexml_load_file() +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +object(SimpleXMLElement)#1 (1) { + [u"book"]=> + array(2) { + [0]=> + object(SimpleXMLElement)#2 (2) { + [u"title"]=> + unicode(19) "The Grapes of Wrath" + [u"author"]=> + unicode(14) "John Steinbeck" + } + [1]=> + object(SimpleXMLElement)#3 (2) { + [u"title"]=> + unicode(9) "The Pearl" + [u"author"]=> + unicode(14) "John Steinbeck" + } + } +} +Done -- 2.50.1