]> granicus.if.org Git - php/commitdiff
interop test
authorChristian Stocker <chregu@php.net>
Mon, 27 Oct 2003 11:24:30 +0000 (11:24 +0000)
committerChristian Stocker <chregu@php.net>
Mon, 27 Oct 2003 11:24:30 +0000 (11:24 +0000)
ext/dom/tests/book.xml [new file with mode: 0644]
ext/dom/tests/dom_import_simplexml.phpt [new file with mode: 0644]

diff --git a/ext/dom/tests/book.xml b/ext/dom/tests/book.xml
new file mode 100644 (file)
index 0000000..ea40508
--- /dev/null
@@ -0,0 +1,10 @@
+<books>
+ <book>
+  <title>The Grapes of Wrath</title>
+  <author>John Steinbeck</author>
+ </book>
+ <book>
+  <title>The Pearl</title>
+  <author>John Steinbeck</author>
+ </book>
+</books>
diff --git a/ext/dom/tests/dom_import_simplexml.phpt b/ext/dom/tests/dom_import_simplexml.phpt
new file mode 100644 (file)
index 0000000..81744aa
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Interop Test: Import from SimpleXML
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php  if (!extension_loaded('simplexml')) die('skip simplexml extension not available');?>
+--FILE--
+<?php
+$s = simplexml_load_file(dirname(__FILE__)."/book.xml");
+if(!$s) {
+  echo "Error while loading the document\n";
+  exit;
+}
+$dom = dom_import_simplexml($s);
+print $dom->ownerDocument->saveXML();
+?>
+--EXPECT--
+<?xml version="1.0"?>
+<books>
+ <book>
+  <title>The Grapes of Wrath</title>
+  <author>John Steinbeck</author>
+ </book>
+ <book>
+  <title>The Pearl</title>
+  <author>John Steinbeck</author>
+ </book>
+</books>