summaryrefslogtreecommitdiff
path: root/ext/simplexml/tests/009.phpt
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-01-17 17:33:10 +0000
committerMarcus Boerger <helly@php.net>2004-01-17 17:33:10 +0000
commitc28af3a66097fcd61406827468ae798a7f7d43ad (patch)
tree6313a7f94509a874d2b0df9f53f7723a9569df9e /ext/simplexml/tests/009.phpt
parent253c97fbfe8e0766acee29d30861a51927030b87 (diff)
downloadphp-git-c28af3a66097fcd61406827468ae798a7f7d43ad.tar.gz
No external xml files
Diffstat (limited to 'ext/simplexml/tests/009.phpt')
-rwxr-xr-xext/simplexml/tests/009.phpt27
1 files changed, 25 insertions, 2 deletions
diff --git a/ext/simplexml/tests/009.phpt b/ext/simplexml/tests/009.phpt
index 6c0a543a8e..d4543f483e 100755
--- a/ext/simplexml/tests/009.phpt
+++ b/ext/simplexml/tests/009.phpt
@@ -4,8 +4,31 @@ SimpleXML and foreach
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
-$sxe = simplexml_load_file(dirname(__FILE__).'/009.xml');
-foreach($sxe as $name=>$val) {
+$sxe = simplexml_load_string(<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd">
+<sxe id="elem1">
+ Plain text.
+ <elem1 attr1='first'>
+ Bla bla 1.
+ <!-- comment -->
+ <elem2>
+ Here we have some text data.
+ <elem3>
+ And here some more.
+ <elem4>
+ Wow once again.
+ </elem4>
+ </elem3>
+ </elem2>
+ </elem1>
+ <elem11 attr2='second'>
+ Bla bla 2.
+ </elem11>
+</sxe>
+EOF
+);
+foreach($sxe->children() as $name=>$val) {
var_dump($name);
var_dump(get_class($val));
var_dump(trim((string)$val));