xref: /PHP-8.2/ext/tidy/tests/tidy_error.phpt (revision 7f2f0c00)
1--TEST--
2Ensure tidy_get_status() returns correct status
3--CREDITS--
4Stefan Priebsch
5--EXTENSIONS--
6tidy
7--FILE--
8<?php
9
10$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
11<html>
12<head>
13<title></title>
14</head>
15<body>
16<p>paragraph</p>
17</body>
18</html>';
19$tidy = tidy_parse_string($html);
20
21echo tidy_get_status($tidy);
22// status 0 indicates no errors or warnings
23
24$html = '<p>paragraph</i>';
25$tidy = tidy_parse_string($html);
26
27echo tidy_get_status($tidy);
28// status 1 indicates warnings
29
30$html = '<bogus>test</bogus>';
31$tidy = tidy_parse_string($html);
32
33echo tidy_get_status($tidy);
34// status 2 indicates error
35
36?>
37--EXPECT--
38012
39