From: Nuno Lopes Date: Tue, 5 Sep 2006 14:55:56 +0000 (+0000) Subject: finish the cleaning. also add a new test X-Git-Tag: php-5.2.0RC4~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc8895ed82230e386fdb0f38139c82aa30311c8b;p=php finish the cleaning. also add a new test --- 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-- + +--FILE-- +isHtml()); + +$tidy = new tidy(); +$tidy->parseString(''); + +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) diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 4c5bf49f57..4de0bbf347 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -31,9 +31,6 @@ #include "ext/standard/info.h" #include "safe_mode.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_object_handlers.h" - #include "tidy.h" #include "buffio.h" @@ -276,13 +273,10 @@ static TIDY_DOC_METHOD(__construct); static TIDY_DOC_METHOD(parseFile); static TIDY_DOC_METHOD(parseString); -static TIDY_NODE_METHOD(__construct); static TIDY_NODE_METHOD(hasChildren); static TIDY_NODE_METHOD(hasSiblings); static TIDY_NODE_METHOD(isComment); static TIDY_NODE_METHOD(isHtml); -static TIDY_NODE_METHOD(isXhtml); -static TIDY_NODE_METHOD(isXml); static TIDY_NODE_METHOD(isText); static TIDY_NODE_METHOD(isJste); static TIDY_NODE_METHOD(isAsp); @@ -353,7 +347,6 @@ static zend_function_entry tidy_funcs_doc[] = { }; static zend_function_entry tidy_funcs_node[] = { - TIDY_NODE_ME(__construct, NULL) TIDY_NODE_ME(hasChildren, NULL) TIDY_NODE_ME(hasSiblings, NULL) TIDY_NODE_ME(isComment, NULL) @@ -1601,13 +1594,6 @@ static PHP_FUNCTION(tidy_get_body) } /* }}} */ -/* {{{ proto tidyNode::tidyNode() - Constructor. */ -static TIDY_NODE_METHOD(__construct) -{ -} -/* }}} */ - /* {{{ proto boolean tidyNode::hasChildren() Returns true if this node has children */ static TIDY_NODE_METHOD(hasChildren)