php-src/ext/dom/tests/dom005.phpt
Christian Stocker 038a7c4831 make test work with libxml2 2.6.x and lower
(I used lowercase html again in the EXPECT part, as this is now the default
behaviour for newer libxml2 releases)
2003-10-30 10:06:00 +00:00

37 lines
987 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
Test 5: HTML Test
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new domdocument;
$dom->loadHTMLFile(dirname(__FILE__)."/test.html");
print "--- save as XML\n";
print adjustDoctype($dom->saveXML());
print "--- save as HTML\n";
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">
<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">
<html>
<head><title>Hello world</title></head>
<body><p>
This is a not well-formed<br>
html files with undeclared entities&nbsp;
</p></body>
</html>