1--TEST--
2proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value) function
3proto string enchant_broker_get_dict_path(resource broker, int dict_type) function
4--CREDITS--
5marcosptf - <marcosptf@yahoo.com.br>
6--EXTENSIONS--
7enchant
8--SKIPIF--
9<?php
10if (!is_object(enchant_broker_init())) {die("skip, resource dont load\n");}
11if (!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, no dictionary installed on this machine! \n");}
12if (defined("LIBENCHANT_VERSION") && version_compare(LIBENCHANT_VERSION, "2", ">")) die('skip libenchant v1 only');
13?>
14--FILE--
15<?php
16$broker = enchant_broker_init();
17$backEndDictType1 = "MYSPELL";
18$backEndDictType2 = "ISPELL";
19$dictTypeValue1 = 1;
20$dictTypeValue2 = 2;
21
22if (is_object($broker)) {
23    echo("OK\n");
24
25    if (enchant_broker_set_dict_path($broker, $dictTypeValue1, $backEndDictType1)) {
26        echo("OK\n");
27
28        if (enchant_broker_set_dict_path($broker, $dictTypeValue2, $backEndDictType2)) {
29            echo("OK\n");
30
31            if (
32                  (enchant_broker_get_dict_path($broker,$dictTypeValue1) == $backEndDictType1) &&
33                  (enchant_broker_get_dict_path($broker,$dictTypeValue2) == $backEndDictType2)
34              ) {
35                   echo("OK\n");
36
37            } else {
38                   echo("broker get dict path has failed \n");
39            }
40
41        } else {
42           echo("broker set dict path {$backEndDictType2} has failed \n");
43        }
44    } else {
45        echo("broker set dict path {$backEndDictType1} has failed \n");
46    }
47} else {
48    echo("broker is not a resource; failed; \n");
49}
50?>
51--EXPECTF--
52OK
53
54Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s
55OK
56
57Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s
58OK
59
60Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
61
62Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
63OK
64