xref: /PHP-5.4/ext/tidy/tests/023.phpt (revision 832eb472)
1--TEST--
2tidy and tidyNode OO
3--SKIPIF--
4<?php if (!extension_loaded('tidy')) echo 'skip'; ?>
5--FILE--
6<?php
7
8//test leaks here:
9new tidy();
10var_dump(new tidy());
11
12echo "-------\n";
13
14$tidy = new tidy();
15$tidy->parseString('<html><?php echo "xpto;" ?></html>');
16
17var_dump(tidy_get_root($tidy)->child[0]->isHtml());
18var_dump(tidy_get_root($tidy)->child[0]->child[0]->isPHP());
19var_dump(tidy_get_root($tidy)->child[0]->child[0]->isAsp());
20var_dump(tidy_get_root($tidy)->child[0]->child[0]->isJste());
21var_dump(tidy_get_root($tidy)->child[0]->child[0]->type === TIDY_NODETYPE_PHP);
22
23var_dump(tidy_get_root($tidy)->child[0]->hasChildren());
24var_dump(tidy_get_root($tidy)->child[0]->child[0]->hasChildren());
25
26?>
27--EXPECT--
28object(tidy)#1 (2) {
29  ["errorBuffer"]=>
30  NULL
31  ["value"]=>
32  NULL
33}
34-------
35bool(true)
36bool(true)
37bool(false)
38bool(false)
39bool(true)
40bool(true)
41bool(false)
42