004.phpt 785 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. tidy_diagnose()
  3. --EXTENSIONS--
  4. tidy
  5. --FILE--
  6. <?php
  7. $a = tidy_parse_string('<HTML></HTML>');
  8. var_dump(tidy_diagnose($a));
  9. echo str_replace("\r", "", tidy_get_error_buffer($a));
  10. $html = <<< HTML
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
  12. <html>
  13. <head><title>foo</title></head>
  14. <body><p>hello</p></body>
  15. </html>
  16. HTML;
  17. $a = tidy_parse_string($html);
  18. var_dump(tidy_diagnose($a));
  19. echo tidy_get_error_buffer($a);
  20. ?>
  21. --EXPECTF--
  22. bool(true)
  23. line 1 column 1 - Warning: missing <!DOCTYPE> declaration
  24. line 1 column 7 - Warning: discarding unexpected </html>
  25. line 1 column 14 - Warning: inserting missing 'title' element
  26. Info: Document content looks like HTML%w%d%S
  27. %S3 warnings%S0 errors%S
  28. bool(true)
  29. Info: Document content looks like HTML 3.2
  30. No warnings or errors were found.