cvs: php-src /ext/dom/tests book.xml dom_import_simplexml.phpt
| From: | Christian Stocker | Date: | Mon, 27 Oct 2003 11:24:31 +0000 |
| Subject: | cvs: php-src /ext/dom/tests book.xml dom_import_simplexml.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-24302@lists.php.net to get a copy of this message | ||
chregu Mon Oct 27 06:24:31 2003 EDT
Added files:
/php-src/ext/dom/tests book.xml dom_import_simplexml.phpt
Log:
interop test
Index: php-src/ext/dom/tests/book.xml
+++ php-src/ext/dom/tests/book.xml
<books>
<book>
<title>The Grapes of Wrath</title>
<author>John Steinbeck</author>
</book>
<book>
<title>The Pearl</title>
<author>John Steinbeck</author>
</book>
</books>
Index: php-src/ext/dom/tests/dom_import_simplexml.phpt
+++ php-src/ext/dom/tests/dom_import_simplexml.phpt
--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>