helly Sat Jan 17 12:33:12 2004 EDT
Modified files:
/php-src/ext/simplexml/tests 006.phpt 005.phpt 009.phpt
Log:
No external xml files
Index: php-src/ext/simplexml/tests/006.phpt
diff -u php-src/ext/simplexml/tests/006.phpt:1.2
php-src/ext/simplexml/tests/006.phpt:1.3
--- php-src/ext/simplexml/tests/006.phpt:1.2 Sun Nov 23 11:20:58 2003
+++ php-src/ext/simplexml/tests/006.phpt Sat Jan 17 12:33:10 2004
@@ -5,7 +5,33 @@
--FILE--
<?php
-$sxe = simplexml_load_file(dirname(__FILE__).'/006.xml');
+$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.
+ <elem111>
+ Foo Bar
+ </elem111>
+ </elem11>
+</sxe>
+EOF
+);
foreach($sxe as $name => $data) {
var_dump($name);
Index: php-src/ext/simplexml/tests/005.phpt
diff -u php-src/ext/simplexml/tests/005.phpt:1.1
php-src/ext/simplexml/tests/005.phpt:1.2
--- php-src/ext/simplexml/tests/005.phpt:1.1 Sat Oct 25 21:04:25 2003
+++ php-src/ext/simplexml/tests/005.phpt Sat Jan 17 12:33:10 2004
@@ -5,7 +5,26 @@
--FILE--
<?php
-$sxe = simplexml_load_file(dirname(__FILE__).'/005.xml');
+$sxe = simplexml_load_string(<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd">
+<sxe id="elem1">
+ Plain text.
+ <elem1 attr1='first'>
+ <!-- comment -->
+ <elem2>
+ Here we have some text data.
+ <elem3>
+ And here some more.
+ <elem4>
+ Wow once again.
+ </elem4>
+ </elem3>
+ </elem2>
+ </elem1>
+</sxe>
+EOF
+);
var_dump(trim($sxe->elem1->elem2));
var_dump(trim($sxe->elem1->elem2->elem3));
Index: php-src/ext/simplexml/tests/009.phpt
diff -u php-src/ext/simplexml/tests/009.phpt:1.2
php-src/ext/simplexml/tests/009.phpt:1.3
--- php-src/ext/simplexml/tests/009.phpt:1.2 Thu Nov 13 16:16:57 2003
+++ php-src/ext/simplexml/tests/009.phpt Sat Jan 17 12:33:10 2004
@@ -4,8 +4,31 @@
<?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));
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php