tidy_error.phpt 707 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Ensure tidy_get_status() returns correct status
  3. --CREDITS--
  4. Stefan Priebsch
  5. --SKIPIF--
  6. <?php
  7. if (!extension_loaded("tidy")) print "skip tidy extension not loaded";
  8. ?>
  9. --FILE--
  10. <?php
  11. $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
  12. <html>
  13. <head>
  14. <title></title>
  15. </head>
  16. <body>
  17. <p>paragraph</p>
  18. </body>
  19. </html>';
  20. $tidy = tidy_parse_string($html);
  21. echo tidy_get_status($tidy);
  22. // status 0 indicates no errors or warnings
  23. $html = '<p>paragraph</i>';
  24. $tidy = tidy_parse_string($html);
  25. echo tidy_get_status($tidy);
  26. // status 1 indicates warnings
  27. $html = '<bogus>test</bogus>';
  28. $tidy = tidy_parse_string($html);
  29. echo tidy_get_status($tidy);
  30. // status 2 indicates error
  31. ?>
  32. --EXPECT--
  33. 012