mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00

The test suite for the tidy extension was written before HTML5 was "standardized". The new tidy-html5 library will output an HTML5 DOCTYPE in the absence of any other information, so the expected test outputs have been updated to accomodate the absense of an HTML version (which is how you declare "HTML5").
35 lines
643 B
PHP
35 lines
643 B
PHP
--TEST--
|
|
OO API
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("tidy")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$tidy = new tidy();
|
|
$str = <<<EOF
|
|
<p>Isto é um texto em Português<br>
|
|
para testes.</p>
|
|
EOF;
|
|
|
|
$tidy->parseString($str, array('output-xhtml'=>1), 'latin1');
|
|
$tidy->cleanRepair();
|
|
$tidy->diagnose();
|
|
var_dump(tidy_warning_count($tidy) > 0);
|
|
var_dump(strlen($tidy->errorBuffer) > 50);
|
|
|
|
echo $tidy;
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
bool(true)
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE html%A>
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title></title>
|
|
</head>
|
|
<body>
|
|
<p>Isto é um texto em Português<br />
|
|
para testes.</p>
|
|
</body>
|
|
</html>
|