xref: /PHP-8.2/ext/enchant/tests/dict_check.phpt (revision 74859783)
1--TEST--
2enchant_dict_check() function
3--CREDITS--
4marcosptf - <marcosptf@yahoo.com.br>
5--EXTENSIONS--
6enchant
7--SKIPIF--
8<?php
9if (!is_object(enchant_broker_init())) {die("skip, resource dont load\n");}
10if (!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, no dictionary installed on this machine! \n");}
11?>
12--FILE--
13<?php
14$broker = enchant_broker_init();
15$dicts = enchant_broker_list_dicts($broker);
16$newWord = "java";
17
18if (is_object($broker)) {
19    echo("OK\n");
20    $requestDict = enchant_broker_request_dict($broker, $dicts[0]['lang_tag']);
21
22    if ($requestDict) {
23        echo("OK\n");
24        enchant_dict_add($requestDict, $newWord);
25
26        if (enchant_dict_check($requestDict, $newWord)) {
27            echo("OK\n");
28
29        } else {
30            echo("dict check new word failed\n");
31        }
32
33    } else {
34    echo("broker request dict failed\n");
35
36    }
37
38} else {
39    echo("broker is not a resource; failed;\n");
40}
41echo "OK\n";
42?>
43--EXPECT--
44OK
45OK
46OK
47OK
48