1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 14:12:38 +02:00
Files
archived-php-src/ext/simplexml/tests/023.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

35 lines
632 B
PHP

--TEST--
SimpleXML: Attributes with entities
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml =<<<EOF
<?xml version='1.0'?>
<!DOCTYPE talks SYSTEM "nbsp.dtd" [
<!ELEMENT root EMPTY>
<!ATTLIST root attr1 CDATA #IMPLIED>
<!ENTITY nbsp "&#38;#x00A0;">
]>
<root attr='foo&nbsp;bar&nbsp;baz'></root>
EOF;
$sxe = simplexml_load_string($xml);
var_dump($sxe);
var_dump($sxe['attr']);
?>
--EXPECTF--
object(SimpleXMLElement)#%d (1) {
["@attributes"]=>
array(1) {
["attr"]=>
string(%d) "foo%sbar%sbaz"
}
}
object(SimpleXMLElement)#%d (1) {
[0]=>
string(%d) "foo%sbar%sbaz"
}