diff options
author | marcosptf <marcosptf@yahoo.com.br> | 2015-08-09 08:09:13 -0300 |
---|---|---|
committer | marcosptf <marcosptf@yahoo.com.br> | 2015-08-09 08:09:13 -0300 |
commit | 49510ef7aa3e65590bf65d11c7f39c006e0631e3 (patch) | |
tree | 12c4ba0db38809c9d67079a7e4c314494299e581 | |
parent | 63990ab18abaf18c819663e7aec1579a4bd60880 (diff) | |
download | php-git-49510ef7aa3e65590bf65d11c7f39c006e0631e3.tar.gz |
Update dict_quick_check_01.phpt
-rw-r--r-- | ext/enchant/tests/dict_quick_check_01.phpt | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/enchant/tests/dict_quick_check_01.phpt b/ext/enchant/tests/dict_quick_check_01.phpt index 3fd5a85739..4ef46829c3 100644 --- a/ext/enchant/tests/dict_quick_check_01.phpt +++ b/ext/enchant/tests/dict_quick_check_01.phpt @@ -3,33 +3,32 @@ enchant_dict_quick_check() function --CREDITS-- marcosptf - <marcosptf@yahoo.com.br> --SKIPIF-- -<?php +<?php if(!extension_loaded('enchant')) die('skip, enchant not loader'); +if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");} +if (!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, dont has dictionary install in this machine! \n");} ?> --FILE-- <?php $broker = enchant_broker_init(); -$lang = "en_EN"; +$dicts = enchant_broker_list_dicts($broker); $word = "aspell"; if (is_resource($broker)) { echo("OK\n"); - $requestDict = enchant_broker_request_dict($broker,$lang); + $requestDict = enchant_broker_request_dict($broker, $dicts[0]['lang_tag']); if ($requestDict) { - enchant_dict_quick_check($requestDict,$word,$sugs); - + enchant_dict_quick_check($requestDict,$word,$sugs); + if (is_array($sugs)) { echo("OK\n"); } else { echo("dict quick check failed\n"); } - } else { - echo("broker request dict failed\n"); - + echo("broker request dict failed\n"); } - } else { echo("broker is not a resource; failed;\n"); } |