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