023.phpt 833 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. tidy and tidyNode OO
  3. --EXTENSIONS--
  4. tidy
  5. --FILE--
  6. <?php
  7. //test leaks here:
  8. new tidy();
  9. var_dump(new tidy());
  10. echo "-------\n";
  11. $tidy = new tidy();
  12. $tidy->parseString('<html><?php echo "xpto;" ?></html>');
  13. var_dump(tidy_get_root($tidy)->child[0]->isHtml());
  14. var_dump(tidy_get_root($tidy)->child[0]->child[0]->isPHP());
  15. var_dump(tidy_get_root($tidy)->child[0]->child[0]->isAsp());
  16. var_dump(tidy_get_root($tidy)->child[0]->child[0]->isJste());
  17. var_dump(tidy_get_root($tidy)->child[0]->child[0]->type === TIDY_NODETYPE_PHP);
  18. var_dump(tidy_get_root($tidy)->child[0]->hasChildren());
  19. var_dump(tidy_get_root($tidy)->child[0]->child[0]->hasChildren());
  20. ?>
  21. --EXPECT--
  22. object(tidy)#1 (2) {
  23. ["errorBuffer"]=>
  24. NULL
  25. ["value"]=>
  26. NULL
  27. }
  28. -------
  29. bool(true)
  30. bool(true)
  31. bool(false)
  32. bool(false)
  33. bool(true)
  34. bool(true)
  35. bool(false)