diff options
author | Marcus Boerger <helly@php.net> | 2004-01-18 15:14:03 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-01-18 15:14:03 +0000 |
commit | bb678c07b589b18609b46a08ce098167d44761f0 (patch) | |
tree | 893de368b487a058f9a9a88ea1166beb5e921538 | |
parent | 9d5ef0070f2311104de685a932e7c131fe3559ea (diff) | |
download | php-git-bb678c07b589b18609b46a08ce098167d44761f0.tar.gz |
Use external files only in 001.phpt & tests for bugs
-rw-r--r-- | ext/simplexml/tests/002.phpt | 19 | ||||
-rwxr-xr-x | ext/simplexml/tests/003.phpt | 23 | ||||
-rwxr-xr-x | ext/simplexml/tests/003.xml | 19 | ||||
-rwxr-xr-x | ext/simplexml/tests/007.phpt | 19 | ||||
-rw-r--r-- | ext/simplexml/tests/008.phpt | 21 | ||||
-rw-r--r-- | ext/simplexml/tests/010.phpt | 24 |
6 files changed, 98 insertions, 27 deletions
diff --git a/ext/simplexml/tests/002.phpt b/ext/simplexml/tests/002.phpt index c5cb2323ff..009101adb0 100644 --- a/ext/simplexml/tests/002.phpt +++ b/ext/simplexml/tests/002.phpt @@ -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(); diff --git a/ext/simplexml/tests/003.phpt b/ext/simplexml/tests/003.phpt index 907b166a0b..0924fd044f 100755 --- a/ext/simplexml/tests/003.phpt +++ b/ext/simplexml/tests/003.phpt @@ -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 index 751921b49e..0000000000 --- a/ext/simplexml/tests/003.xml +++ /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 diff --git a/ext/simplexml/tests/007.phpt b/ext/simplexml/tests/007.phpt index c7f3fc1849..d41c84bdeb 100755 --- a/ext/simplexml/tests/007.phpt +++ b/ext/simplexml/tests/007.phpt @@ -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); diff --git a/ext/simplexml/tests/008.phpt b/ext/simplexml/tests/008.phpt index 1726726a1a..68b6f39351 100644 --- a/ext/simplexml/tests/008.phpt +++ b/ext/simplexml/tests/008.phpt @@ -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("***")); ?> diff --git a/ext/simplexml/tests/010.phpt b/ext/simplexml/tests/010.phpt index 628c945098..20e2f89a26 100644 --- a/ext/simplexml/tests/010.phpt +++ b/ext/simplexml/tests/010.phpt @@ -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=== |