]> granicus.if.org Git - php/commitdiff
More testing
authorMarcus Boerger <helly@php.net>
Sat, 25 Oct 2003 21:07:37 +0000 (21:07 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 25 Oct 2003 21:07:37 +0000 (21:07 +0000)
ext/simplexml/tests/001.phpt
ext/simplexml/tests/002.phpt
ext/simplexml/tests/003.phpt [new file with mode: 0755]
ext/simplexml/tests/003.xml [new file with mode: 0755]
ext/simplexml/tests/004.phpt [new file with mode: 0755]
ext/simplexml/tests/004.xml [new file with mode: 0755]
ext/simplexml/tests/sxe.xml

index 3c1c8869a80bbc6a48154dee7b43ddbe833b7c4f..123c91d24493d46f4ce8d7fcff305f13ba12c25b 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-SimpleXML without CDATA
+SimpleXML: Simple document
 --SKIPIF--
 <?php if (!extension_loaded("simplexml")) print "skip"; ?>
 --FILE--
@@ -25,11 +25,6 @@ simplexml_element Object
                 (
                     [elem3] => simplexml_element Object
                         (
-                            [included-entity] => simplexml_element Object
-                                (
-                                    [included-entity] => This is text included from an entity
-                                )
-
                             [elem4] => simplexml_element Object
                                 (
                                     [test] => simplexml_element Object
index 98c1d27a46810e3ff8395ddb8ed5fe9b03addb18..c5cb2323ff1e719c5c5ab5f32f21a60255c6d1e0 100644 (file)
@@ -27,11 +27,6 @@ simplexml_element Object
                 (
                     [elem3] => simplexml_element Object
                         (
-                            [included-entity] => simplexml_element Object
-                                (
-                                    [included-entity] => This is text included from an entity
-                                )
-
                             [elem4] => simplexml_element Object
                                 (
                                     [test] => simplexml_element Object
diff --git a/ext/simplexml/tests/003.phpt b/ext/simplexml/tests/003.phpt
new file mode 100755 (executable)
index 0000000..907b166
--- /dev/null
@@ -0,0 +1,48 @@
+--TEST--
+SimpleXML and Entities
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php 
+
+$sxe = simplexml_load_file(dirname(__FILE__).'/003.xml');
+
+print_r($sxe);
+
+echo "---Done---\n";
+
+?>
+--EXPECT--
+simplexml_element Object
+(
+    [elem1] => simplexml_element Object
+        (
+            [comment] => simplexml_element Object
+                (
+                )
+
+            [elem2] => simplexml_element Object
+                (
+                    [elem3] => simplexml_element Object
+                        (
+                            [included-entity] => simplexml_element Object
+                                (
+                                    [included-entity] => This is text included from an entity
+                                )
+
+                            [elem4] => simplexml_element Object
+                                (
+                                    [test] => simplexml_element Object
+                                        (
+                                        )
+
+                                )
+
+                        )
+
+                )
+
+        )
+
+)
+---Done--- 
diff --git a/ext/simplexml/tests/003.xml b/ext/simplexml/tests/003.xml
new file mode 100755 (executable)
index 0000000..751921b
--- /dev/null
@@ -0,0 +1,19 @@
+<?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
diff --git a/ext/simplexml/tests/004.phpt b/ext/simplexml/tests/004.phpt
new file mode 100755 (executable)
index 0000000..a432371
--- /dev/null
@@ -0,0 +1,48 @@
+--TEST--
+SimpleXML and CDATA
+--SKIPIF--
+<?php if (!extension_loaded("simplexml")) print "skip"; ?>
+--FILE--
+<?php 
+
+$sxe = simplexml_load_file(dirname(__FILE__).'/004.xml');
+
+print_r($sxe);
+
+echo "---Done---\n";
+
+?>
+--EXPECT--
+simplexml_element Object
+(
+    [elem1] => simplexml_element Object
+        (
+            [comment] => simplexml_element Object
+                (
+                )
+
+            [elem2] => simplexml_element Object
+                (
+                    [elem3] => simplexml_element Object
+                        (
+                            [included-entity] => simplexml_element Object
+                                (
+                                    [included-entity] => This is text included from an entity
+                                )
+
+                            [elem4] => simplexml_element Object
+                                (
+                                    [test] => simplexml_element Object
+                                        (
+                                        )
+
+                                )
+
+                        )
+
+                )
+
+        )
+
+)
+---Done--- 
diff --git a/ext/simplexml/tests/004.xml b/ext/simplexml/tests/004.xml
new file mode 100755 (executable)
index 0000000..a3ef057
--- /dev/null
@@ -0,0 +1,19 @@
+<?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>
+   <![CDATA[CDATA block]]>
+   <elem3>
+    <elem4>
+     <?test processing instruction ?>
+    </elem4>
+   </elem3>
+  </elem2>
+ </elem1>
+</sxe> 
\ No newline at end of file
index 751921b49e76dd70b7a15152821592f02d769172..909b4e652c446f093fc234851910e7f4608a1e8c 100755 (executable)
@@ -4,12 +4,10 @@
 %incent;
 ]>
 <sxe id="elem1">
- Plain text.
  <elem1 attr1='first'>
   <!-- comment -->
   <elem2>
    <elem3>
-    &included-entity;
     <elem4>
      <?test processing instruction ?>
     </elem4>