]> granicus.if.org Git - php/commitdiff
ext/tidy: work around a legacy libtidy bug in a test.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 10 Jun 2016 03:39:07 +0000 (23:39 -0400)
committerAnatol Belski <ab@php.net>
Mon, 11 Jul 2016 12:05:43 +0000 (14:05 +0200)
Our existing test 024.phpt actually tests incorrect behavior. There is
a self-closing tag present in the input, but the expected output has
that same tag half-open (i.e. open but never closed). To support
tidy-html5, which does the right thing, that test needed to be
changed. The self-closing tag was replaced by an explicit pair of
tags, and some extra whitespace fudging was done.

ext/tidy/tests/024.phpt

index b09f5b464348297dbb822995bb041cbb16a2fa23..6a258b30aad0b6391a6e57736ac9f140d385e891 100644 (file)
@@ -13,28 +13,27 @@ if (strtotime(tidy_get_release()) < strtotime('20 january 2007')) die ('skip old
 $contents = '
 <wps:block>
 <wps:var>
-<wps:value/>
+<wps:value></wps:value>
 </wps:var>
 </wps:block>';
 
 $config = array(
+'doctype' => 'omit',
 'new-blocklevel-tags' => 'wps:block,wps:var,wps:value',
 'newline' => 'LF'
 );
 
 $tidy = tidy_parse_string($contents, $config, 'utf8');
 $tidy->cleanRepair();
-
-var_dump($tidy->value);
+echo $tidy;
 
 ?>
 --EXPECTF--
-string(11%d) "<html>
+<html>
 <head>
 <title></title>
 </head>
 <body>
-<wps:block>%w<wps:var>
-<wps:value></wps:var>%w</wps:block>
+<wps:block>%w<wps:var>%w<wps:value></wps:value>%w</wps:var>%w</wps:block>
 </body>
-</html>"
+</html>