mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
add tests
This commit is contained in:
parent
aebc5833a9
commit
6f95fa95cc
3 changed files with 38 additions and 0 deletions
22
ext/dom/tests/bug37456.phpt
Normal file
22
ext/dom/tests/bug37456.phpt
Normal file
|
@ -0,0 +1,22 @@
|
|||
--TEST--
|
||||
Bug # 37456 (DOMElement->setAttribute() loops forever)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->resolveExternals = true;
|
||||
$doc->load(dirname(__FILE__)."/dom.xml");
|
||||
|
||||
$root = $doc->getElementsByTagName('foo')->item(0);
|
||||
$root->setAttribute('bar', '>');
|
||||
$attr = $root->setAttribute('bar', 'newval');
|
||||
print $attr->nodeValue;
|
||||
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
newval
|
||||
|
8
ext/dom/tests/dom.ent
Normal file
8
ext/dom/tests/dom.ent
Normal file
|
@ -0,0 +1,8 @@
|
|||
<!ENTITY amp "&#38;">
|
||||
<!ENTITY gt ">">
|
||||
<!ENTITY % coreattrs "title CDATA #IMPLIED">
|
||||
<!ENTITY % attrs "%coreattrs;">
|
||||
<!ATTLIST foo bar CDATA #IMPLIED>
|
||||
<!ELEMENT foo (#PCDATA)>
|
||||
<!ELEMENT root (foo)+>
|
||||
<!ATTLIST th %attrs; >
|
8
ext/dom/tests/dom.xml
Normal file
8
ext/dom/tests/dom.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE root [
|
||||
<!ENTITY % incent SYSTEM "dom.ent">
|
||||
%incent;
|
||||
]>
|
||||
<root>
|
||||
<foo bar="" />
|
||||
</root>
|
Loading…
Add table
Add a link
Reference in a new issue