]> granicus.if.org Git - php/commitdiff
Use external files only in 001.phpt & tests for bugs
authorMarcus Boerger <helly@php.net>
Sun, 18 Jan 2004 15:14:03 +0000 (15:14 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 18 Jan 2004 15:14:03 +0000 (15:14 +0000)
ext/simplexml/tests/002.phpt
ext/simplexml/tests/003.phpt
ext/simplexml/tests/003.xml [deleted file]
ext/simplexml/tests/007.phpt
ext/simplexml/tests/008.phpt
ext/simplexml/tests/010.phpt

index c5cb2323ff1e719c5c5ab5f32f21a60255c6d1e0..009101adb088c50e018de1c8156091a6503fdb3c 100644 (file)
@@ -5,7 +5,24 @@ SimpleXML and clone
 --FILE--
 <?php 
 
-$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml');
+$xml =<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd">
+<sxe id="elem1">
+ <elem1 attr1='first'>
+  <!-- comment -->
+  <elem2>
+   <elem3>
+    <elem4>
+     <?test processing instruction ?>
+    </elem4>
+   </elem3>
+  </elem2>
+ </elem1>
+</sxe>
+EOF;
+
+$sxe = simplexml_load_string($xml);
 
 $copy = $sxe->__clone();
 
index 907b166a0b5a2a6486a8f9dcd4205ccc753918b4..0924fd044fbc48c672f4101732a72fab2918c8af 100755 (executable)
@@ -5,7 +5,28 @@ SimpleXML and Entities
 --FILE--
 <?php 
 
-$sxe = simplexml_load_file(dirname(__FILE__).'/003.xml');
+$xml =<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd" [
+<!ENTITY included-entity "This is text included from an entity">
+]>
+<sxe id="elem1">
+ Plain text.
+ <elem1 attr1='first'>
+  <!-- comment -->
+  <elem2>
+   <elem3>
+    &included-entity;
+    <elem4>
+     <?test processing instruction ?>
+    </elem4>
+   </elem3>
+  </elem2>
+ </elem1>
+</sxe>
+EOF;
+
+$sxe = simplexml_load_string($xml);
 
 print_r($sxe);
 
diff --git a/ext/simplexml/tests/003.xml b/ext/simplexml/tests/003.xml
deleted file mode 100755 (executable)
index 751921b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE sxe SYSTEM "notfound.dtd" [
-<!ENTITY % incent SYSTEM "sxe.ent">
-%incent;
-]>
-<sxe id="elem1">
- Plain text.
- <elem1 attr1='first'>
-  <!-- comment -->
-  <elem2>
-   <elem3>
-    &included-entity;
-    <elem4>
-     <?test processing instruction ?>
-    </elem4>
-   </elem3>
-  </elem2>
- </elem1>
-</sxe> 
\ No newline at end of file
index c7f3fc18492c8f1824832fc3a683e25d4fc0bd2a..d41c84bdebba99458e0fd36ee4e307d4e4c12677 100755 (executable)
@@ -5,7 +5,24 @@ SimpleXML and attributes
 --FILE--
 <?php 
 
-$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml');
+$xml =<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd">
+<sxe id="elem1">
+ <elem1 attr1='first'>
+  <!-- comment -->
+  <elem2>
+   <elem3>
+    <elem4>
+     <?test processing instruction ?>
+    </elem4>
+   </elem3>
+  </elem2>
+ </elem1>
+</sxe>
+EOF;
+
+$sxe = simplexml_load_string($xml);
 
 echo "===Property===\n";
 var_dump($sxe->elem1);
index 1726726a1a86c6f031b36edd36074d53a4da781c..68b6f39351cd85ee177fe7527178e41b77d274df 100644 (file)
@@ -4,7 +4,26 @@ SimpleXML and XPath
 <?php if (!extension_loaded("simplexml")) print "skip"; ?>
 --FILE--
 <?php 
-$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml');
+
+$xml =<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd">
+<sxe id="elem1">
+ <elem1 attr1='first'>
+  <!-- comment -->
+  <elem2>
+   <elem3>
+    <elem4>
+     <?test processing instruction ?>
+    </elem4>
+   </elem3>
+  </elem2>
+ </elem1>
+</sxe>
+EOF;
+
+$sxe = simplexml_load_string($xml);
+
 var_dump($sxe->xpath("elem1/elem2/elem3/elem4"));
 var_dump($sxe->xpath("***"));
 ?>
index 628c9450982b6c052de72c9cbe3e6b0963c19609..20e2f89a268175492a87c54af9ca57b347780bd6 100644 (file)
@@ -9,13 +9,29 @@ class simplexml_inherited extends simplexml_element
 {
 }
 
-$sxe = simplexml_load_file(dirname(__FILE__).'/sxe.xml', 'simplexml_inherited');
+$xml =<<<EOF
+<?xml version='1.0'?>
+<!DOCTYPE sxe SYSTEM "notfound.dtd">
+<sxe id="elem1">
+ <elem1 attr1='first'>
+  <!-- comment -->
+  <elem2>
+   <elem3>
+    <elem4>
+     <?test processing instruction ?>
+    </elem4>
+   </elem3>
+  </elem2>
+ </elem1>
+</sxe>
+EOF;
+
+$sxe = simplexml_load_string($xml, 'simplexml_inherited');
 
 print_r($sxe);
 
-echo "---Done---\n";
-
 ?>
+===DONE===
 --EXPECT--
 simplexml_inherited Object
 (
@@ -44,4 +60,4 @@ simplexml_inherited Object
         )
 
 )
----Done--- 
+===DONE===