]> granicus.if.org Git - php/commitdiff
- update, wrong file added
authorPierre Joye <pajoye@php.net>
Tue, 21 Mar 2006 18:57:04 +0000 (18:57 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 21 Mar 2006 18:57:04 +0000 (18:57 +0000)
ext/enchant/tests/broker_request_dict.phpt

index a061b64b47aa0dfad7134c3f6e88b3867918dce9..5744da6747ea98198f6c21cbeef9b35d6ab49a09 100644 (file)
@@ -7,14 +7,23 @@ if(!extension_loaded('enchant')) die('skip, enchant not loader');
 --FILE--
 <?php
 $broker = enchant_broker_init();
-if (is_resource($broker)) {
-       echo "OK\n";
-       enchant_broker_free($broker);
-}  else {
+if (!is_resource($broker)) {
        exit("init failed\n");
 }
 
-$dict_describe = enchant_broker_list_dicts($r);
+$dicts = enchant_broker_list_dicts($broker);
+if (is_array($dicts)) {
+       if (count($dicts)) {
+               $dict = enchant_broker_request_dict($broker, $dicts[0]['lang_tag']);
+               if (is_resource($dict)) {
+                       echo "OK\n";
+               } else {
+                       echo "fail to request " . $dicts[0]['lang_tag'];
+               }
+       }
+} else {
+       exit("list dicts failed\n");
+}
 echo "OK\n";
 ?>
 --EXPECT--