2003-08-01 00:22:43 +00:00
|
|
|
--TEST--
|
|
|
|
tidy_diagnose()
|
|
|
|
--SKIPIF--
|
2003-08-06 21:32:46 +00:00
|
|
|
<?php if (!extension_loaded("tidy")) print "skip"; ?>
|
2003-08-01 00:22:43 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2012-01-21 11:32:56 +00:00
|
|
|
$a = tidy_parse_string('<HTML></HTML>');
|
|
|
|
var_dump(tidy_diagnose($a));
|
2012-05-21 10:51:24 +00:00
|
|
|
echo str_replace("\r", "", tidy_get_error_buffer($a));
|
2012-01-21 11:32:56 +00:00
|
|
|
|
|
|
|
$html = <<< HTML
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
|
|
<html>
|
|
|
|
<head><title>foo</title></head>
|
|
|
|
<body><p>hello</p></body>
|
|
|
|
</html>
|
|
|
|
HTML;
|
|
|
|
$a = tidy_parse_string($html);
|
|
|
|
var_dump(tidy_diagnose($a));
|
|
|
|
echo tidy_get_error_buffer($a);
|
2003-08-01 00:22:43 +00:00
|
|
|
?>
|
|
|
|
--EXPECT--
|
2012-01-21 11:32:56 +00:00
|
|
|
bool(true)
|
2003-08-01 00:22:43 +00:00
|
|
|
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
|
|
|
|
line 1 column 7 - Warning: discarding unexpected </html>
|
|
|
|
line 1 column 14 - Warning: inserting missing 'title' element
|
|
|
|
Info: Document content looks like HTML 3.2
|
2012-01-21 11:32:56 +00:00
|
|
|
3 warnings, 0 errors were found!
|
|
|
|
bool(true)
|
|
|
|
Info: Document content looks like HTML 3.2
|
|
|
|
No warnings or errors were found.
|