]> granicus.if.org Git - php/commitdiff
add test
authorRob Richards <rrichards@php.net>
Wed, 17 May 2006 16:32:35 +0000 (16:32 +0000)
committerRob Richards <rrichards@php.net>
Wed, 17 May 2006 16:32:35 +0000 (16:32 +0000)
ext/dom/tests/bug37456.phpt [new file with mode: 0644]
ext/dom/tests/dom.ent [new file with mode: 0644]
ext/dom/tests/dom.xml [new file with mode: 0644]

diff --git a/ext/dom/tests/bug37456.phpt b/ext/dom/tests/bug37456.phpt
new file mode 100644 (file)
index 0000000..904712f
--- /dev/null
@@ -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', '&gt;');
+$attr = $root->setAttribute('bar', 'newval');
+print $attr->nodeValue;
+
+
+?>
+--EXPECT--
+
+newval
+
diff --git a/ext/dom/tests/dom.ent b/ext/dom/tests/dom.ent
new file mode 100644 (file)
index 0000000..987ff9d
--- /dev/null
@@ -0,0 +1,8 @@
+<!ENTITY amp     "&#38;#38;">
+<!ENTITY gt      "&#62;">
+<!ENTITY % coreattrs "title CDATA #IMPLIED">
+<!ENTITY % attrs "%coreattrs;">
+<!ATTLIST foo bar CDATA #IMPLIED>
+<!ELEMENT foo (#PCDATA)>
+<!ELEMENT root (foo)+>
+<!ATTLIST th %attrs; >
\ No newline at end of file
diff --git a/ext/dom/tests/dom.xml b/ext/dom/tests/dom.xml
new file mode 100644 (file)
index 0000000..09ac674
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE root [
+<!ENTITY % incent SYSTEM "dom.ent">
+%incent;
+]>
+<root>
+   <foo bar="" />
+</root>
\ No newline at end of file