From 11a63934d43fb1cfbb9b181319e5965b6338d656 Mon Sep 17 00:00:00 2001 From: Christian Stocker Date: Mon, 27 Oct 2003 11:34:45 +0000 Subject: [PATCH] added interop test --- ext/simplexml/tests/book.xml | 10 +++++++++ ext/simplexml/tests/simplexml_import_dom.phpt | 22 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ext/simplexml/tests/book.xml create mode 100755 ext/simplexml/tests/simplexml_import_dom.phpt 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 -- 2.50.1