summaryrefslogtreecommitdiff
path: root/ext/tidy/tests/020.phpt
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2006-09-05 14:55:56 +0000
committerNuno Lopes <nlopess@php.net>2006-09-05 14:55:56 +0000
commitdc8895ed82230e386fdb0f38139c82aa30311c8b (patch)
treec7371beaf97151d48a3ee3332e4d9b6352d3d88f /ext/tidy/tests/020.phpt
parentc57bfd9a6606aaa5e53693e0c95cacf07837b316 (diff)
downloadphp-git-dc8895ed82230e386fdb0f38139c82aa30311c8b.tar.gz
finish the cleaning. also add a new test
Diffstat (limited to 'ext/tidy/tests/020.phpt')
-rw-r--r--ext/tidy/tests/020.phpt49
1 files changed, 49 insertions, 0 deletions
diff --git a/ext/tidy/tests/020.phpt b/ext/tidy/tests/020.phpt
new file mode 100644
index 0000000000..e7ee4b3c0c
--- /dev/null
+++ b/ext/tidy/tests/020.phpt
@@ -0,0 +1,49 @@
+--TEST--
+tidy and tidyNode OO
+--SKIPIF--
+<?php if (!extension_loaded('tidy')) echo 'skip'; ?>
+--FILE--
+<?php
+
+//test leaks here:
+new tidyNode();
+var_dump(new tidyNode());
+new tidy();
+var_dump(new tidy());
+
+echo "-------\n";
+
+$x = new tidyNode();
+var_dump($x->isHtml());
+
+$tidy = new tidy();
+$tidy->parseString('<html><?php echo "xpto;" ?></html>');
+
+var_dump(tidy_get_root($tidy)->child[0]->isHtml());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->isPHP());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->isAsp());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->isJste());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->type === TIDY_NODETYPE_PHP);
+
+var_dump(tidy_get_root($tidy)->child[0]->hasChildren());
+var_dump(tidy_get_root($tidy)->child[0]->child[0]->hasChildren());
+
+?>
+--EXPECT--
+object(tidyNode)#1 (0) {
+}
+object(tidy)#1 (2) {
+ ["errorBuffer"]=>
+ NULL
+ ["value"]=>
+ NULL
+}
+-------
+bool(false)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+bool(false)