com php-src: Update dict_quick_check_01.phpt: e xt/enchant/tests/dict_quick_check_01.phpt
| From: | Xinchen Hui | Date: | Sun, 09 Aug 2015 11:09:13 +0000 |
| Subject: | com php-src: Update dict_quick_check_01.phpt: e xt/enchant/tests/dict_quick_check_01.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88409@lists.php.net to get a copy of this message | ||
Commit: 49510ef7aa3e65590bf65d11c7f39c006e0631e3
Author: marcosptf <marcosptf@yahoo.com.br> Sun, 9 Aug 2015 08:09:13 -0300
Parents: 63990ab18abaf18c819663e7aec1579a4bd60880
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=49510ef7aa3e65590bf65d11c7f39c006e0631e3
Log:
Update dict_quick_check_01.phpt
Changed paths:
M ext/enchant/tests/dict_quick_check_01.phpt
Diff:
diff --git a/ext/enchant/tests/dict_quick_check_01.phpt b/ext/enchant/tests/dict_quick_check_01.phpt
index 3fd5a85..4ef4682 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");
}