Use external files only in 001.phpt & tests for bugs

This commit is contained in:
Marcus Boerger 2004-01-18 15:14:03 +00:00
parent 9d5ef0070f
commit bb678c07b5
6 changed files with 98 additions and 27 deletions

View 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();

View File

@ -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);

View File

@ -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>

View File

@ -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);

View 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("***"));
?>

View 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===