mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Add extra test for stale entity references
This commit is contained in:
34
ext/dom/tests/entity_reference_stale_03.phpt
Normal file
34
ext/dom/tests/entity_reference_stale_03.phpt
Normal file
@@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
Entity references with stale entity declaration 03
|
||||
--EXTENSIONS--
|
||||
dom
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
foreach (['firstChild', 'lastChild', 'textContent', 'childNodes'] as $prop) {
|
||||
$dom = DOM\XMLDocument::createFromString(<<<XML
|
||||
<!DOCTYPE foo [
|
||||
<!ENTITY foo "bar">
|
||||
]>
|
||||
<foo>&foo;</foo>
|
||||
XML);
|
||||
|
||||
$ref = $dom->documentElement->firstChild;
|
||||
$decl = $ref->firstChild;
|
||||
|
||||
$nodes = $ref->childNodes;
|
||||
$dom->removeChild($dom->doctype);
|
||||
unset($decl);
|
||||
|
||||
var_dump($ref->$prop);
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
object(DOM\NodeList)#1 (1) {
|
||||
["length"]=>
|
||||
int(0)
|
||||
}
|
||||
Reference in New Issue
Block a user