From: Christian Stocker Date: Mon, 27 Oct 2003 11:34:45 +0000 (+0000) Subject: added interop test X-Git-Tag: RELEASE_2_0_0RC1~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11a63934d43fb1cfbb9b181319e5965b6338d656;p=php added interop test --- diff --git a/ext/simplexml/tests/book.xml b/ext/simplexml/tests/book.xml new file mode 100644 index 0000000000..ea40508e01 --- /dev/null +++ b/ext/simplexml/tests/book.xml @@ -0,0 +1,10 @@ + + + The Grapes of Wrath + John Steinbeck + + + The Pearl + John Steinbeck + + diff --git a/ext/simplexml/tests/simplexml_import_dom.phpt b/ext/simplexml/tests/simplexml_import_dom.phpt new file mode 100755 index 0000000000..c66ba8f087 --- /dev/null +++ b/ext/simplexml/tests/simplexml_import_dom.phpt @@ -0,0 +1,22 @@ +--TEST-- +Interop: simplexml_import_dom +--SKIPIF-- + + +--FILE-- +load(dirname(__FILE__)."/book.xml"); +if(!$dom) { + echo "Error while parsing the document\n"; + exit; +} +$s = simplexml_import_dom($dom); +$books = $s->book; +foreach ($books as $book) { + echo "{$book->title} was written by {$book->author}\n"; +} +?> +--EXPECT-- +The Grapes of Wrath was written by John Steinbeck +The Pearl was written by John Steinbeck