dict_quick_check.phpt 773 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. enchant_dict_quick_check() basic test
  3. --CREDITS--
  4. marcosptf - <marcosptf@yahoo.com.br>
  5. --SKIPIF--
  6. <?php
  7. if(!extension_loaded('enchant')) die('skip, enchant not loader');
  8. if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");}
  9. if (!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, dont has dictionary install in this machine! \n");}
  10. $tag = 'en_US';
  11. $r = enchant_broker_init();
  12. if (!enchant_broker_dict_exists($r, $tag))
  13. die('skip, no dictionary for ' . $tag . ' tag');
  14. ?>
  15. --FILE--
  16. <?php
  17. $tag = 'en_US';
  18. $r = enchant_broker_init();
  19. $d = enchant_broker_request_dict($r, $tag);
  20. enchant_dict_quick_check($d, 'soong', $suggs);
  21. echo "Elements: " . count($suggs) . "\n";
  22. echo "Done\n";
  23. ?>
  24. --EXPECTF--
  25. Elements: %d
  26. Done