]> granicus.if.org Git - php/commitdiff
make test work with libxml2 2.6.x and lower
authorChristian Stocker <chregu@php.net>
Thu, 30 Oct 2003 10:06:00 +0000 (10:06 +0000)
committerChristian Stocker <chregu@php.net>
Thu, 30 Oct 2003 10:06:00 +0000 (10:06 +0000)
(I used lowercase html again in the EXPECT part, as this is now the default
behaviour for newer libxml2 releases)

ext/dom/tests/dom005.phpt

index 9ce32b4a192e4fc7f224add03cc8b691a3e2c5f0..ff8a79a5ff72a8bc320b564e06931a7fe1039b1b 100644 (file)
@@ -8,20 +8,25 @@ $dom = new domdocument;
 $dom->loadHTMLFile(dirname(__FILE__)."/test.html");
 print  "--- save as XML\n";
 
-print $dom->saveXML();
+print adjustDoctype($dom->saveXML());
 print  "--- save as HTML\n";
 
-print $dom->saveHTML();
+print adjustDoctype($dom->saveHTML());
+
+function adjustDoctype($xml) {
+    return str_replace("DOCTYPE HTML","DOCTYPE html",$xml);
+}
+
 --EXPECT--
 --- save as XML
 <?xml version="1.0" standalone="yes"?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
 <html><head><title>Hello world</title></head><body><p>
 This is a not well-formed<br/>
 html files with undeclared entities 
 </p></body></html>
 --- save as HTML
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
 <html>
 <head><title>Hello world</title></head>
 <body><p>