]> granicus.if.org Git - php/commitdiff
Create broker_request_dict_01.phpt
authormarcosptf <marcosptf@yahoo.com.br>
Fri, 7 Aug 2015 14:32:29 +0000 (11:32 -0300)
committermarcosptf <marcosptf@yahoo.com.br>
Fri, 7 Aug 2015 14:32:29 +0000 (11:32 -0300)
ext/enchant/tests/broker_request_dict_01.phpt [new file with mode: 0644]

diff --git a/ext/enchant/tests/broker_request_dict_01.phpt b/ext/enchant/tests/broker_request_dict_01.phpt
new file mode 100644 (file)
index 0000000..85c492e
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+enchant_broker_request_dict() function
+--CREDITS--
+marcosptf - <marcosptf@yahoo.com.br>
+--SKIPIF--
+<?php 
+if(!extension_loaded('enchant')) die('skip, enchant not loader');
+?>
+--FILE--
+<?php
+$broker = enchant_broker_init();
+if (!is_resource($broker)) {
+    exit("init failed\n");
+}
+
+$dicts = enchant_broker_list_dicts($broker);
+if (is_array($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--
+OK
+OK