22bfd01ac589f02ad1c649ab73602dbd78f0dc1d.svn-base 866 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // $Rev: 133 $
  3. error_reporting(E_ALL);
  4. include_once('../simple_html_dom.php');
  5. $start = microtime();
  6. list($bu, $bs) = explode(' ', $start);
  7. $html = file_get_html('slickspeed.htm');
  8. list($eu, $es) = explode(' ', microtime());
  9. echo sprintf('parse (%.1f)', ((float)$eu+(float)$es-(float)$bu-(float)$bs)*1000).'<br><br>';
  10. assert(count($html->find('#title'))==1);
  11. assert(count($html->find('div'))==51);
  12. assert(count($html->find('div[class]'))==51);
  13. assert(count($html->find('div.example'))==43);
  14. assert(count($html->find('div[class=example]'))==43);
  15. assert(count($html->find('.note'))==14);
  16. assert(count($html->find('div[class^=exa]'))==43);
  17. assert(count($html->find('div[class$=mple]'))==43);
  18. assert(count($html->find('div[class*=e]'))==50);
  19. assert(count($html->find('div[class!=made_up]'))==51);
  20. assert(count($html->find('p'))==324);
  21. echo 'All pass!<br>';
  22. ?>