xref: /PHP-8.3/ext/tidy/tests/023.phpt (revision 0acf77e2)
1--TEST--
2tidy and tidyNode OO
3--EXTENSIONS--
4tidy
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>');
16var_dump(rtrim($tidy->value));
17
18echo "-------\n";
19
20var_dump(tidy_get_root($tidy)->child[0]->isHtml());
21var_dump(tidy_get_root($tidy)->child[0]->child[0]->isPHP());
22var_dump(tidy_get_root($tidy)->child[0]->child[0]->isAsp());
23var_dump(tidy_get_root($tidy)->child[0]->child[0]->isJste());
24var_dump(tidy_get_root($tidy)->child[0]->child[0]->type === TIDY_NODETYPE_PHP);
25
26var_dump(tidy_get_root($tidy)->child[0]->hasChildren());
27var_dump(tidy_get_root($tidy)->child[0]->child[0]->hasChildren());
28
29?>
30--EXPECTF--
31object(tidy)#1 (2) {
32  ["errorBuffer"]=>
33  NULL
34  ["value"]=>
35  NULL
36}
37-------
38string(%d) "<html>
39<?php echo "xpto;" ?>
40<head>
41<title></title>
42</head>
43<body>
44</body>
45</html>"
46-------
47bool(true)
48bool(true)
49bool(false)
50bool(false)
51bool(true)
52bool(true)
53bool(false)
54