Annotation of embedaddon/php/ext/tidy/tests/tidy_error.phpt, revision 1.1.1.1

1.1       misho       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: 
                     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: 
                     23: echo 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: 
                     29: echo tidy_get_status($tidy);
                     30: // status 1 indicates warnings
                     31: 
                     32: $html = '<bogus>test</bogus>';
                     33: $tidy = tidy_parse_string($html);
                     34: 
                     35: echo tidy_get_status($tidy);
                     36: // status 2 indicates error
                     37: 
                     38: ?>
                     39: --EXPECT--
                     40: 012
                     41: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>