]> granicus.if.org Git - php/commitdiff
Update dict_quick_check_01.phpt
authormarcosptf <marcosptf@yahoo.com.br>
Sun, 9 Aug 2015 11:09:13 +0000 (08:09 -0300)
committermarcosptf <marcosptf@yahoo.com.br>
Sun, 9 Aug 2015 11:09:13 +0000 (08:09 -0300)
ext/enchant/tests/dict_quick_check_01.phpt

index 3fd5a85739d574cb0a20bae1c426ee25d8260a9a..4ef46829c35ad0842f96896a9b1b4ab343952bc3 100644 (file)
@@ -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");
 }