1--TEST--
2enchant_dict_store_replacement() 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$wrongWord = "sava";
17$rightWord = "java";
18
19if (is_object($broker)) {
20    echo("OK\n");
21    $requestDict = enchant_broker_request_dict($broker, $dicts[0]['lang_tag']);
22
23    if ($requestDict) {
24        echo("OK\n");
25        $AddtoPersonalDict = enchant_dict_store_replacement($requestDict,$wrongWord,$rightWord);
26
27        if (NULL === $AddtoPersonalDict) {
28            var_dump($AddtoPersonalDict);
29        } else {
30            echo("dict add to personal failed\n");
31        }
32    } else {
33        echo("broker request dict failed\n");
34    }
35} else {
36    echo("broker is not a resource; failed;\n");
37}
38echo "OK\n";
39?>
40--EXPECT--
41OK
42OK
43NULL
44OK
45