1--TEST--
2enchant_dict_store_replacement() function
3--CREDITS--
4marcosptf - <marcosptf@yahoo.com.br>
5--SKIPIF--
6<?php
7if(!extension_loaded('enchant')) die('skip, enchant not loader');
8if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");}
9if (!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, dont has dictionary install in this machine! \n");}
10?>
11--FILE--
12<?php
13$broker = enchant_broker_init();
14$dicts = enchant_broker_list_dicts($broker);
15$wrongWord = "sava";
16$rightWord = "java";
17
18if (is_resource($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        $AddtoPersonalDict = enchant_dict_store_replacement($requestDict,$wrongWord,$rightWord);
25
26        if (NULL === $AddtoPersonalDict) {
27            var_dump($AddtoPersonalDict);
28        } else {
29            echo("dict add to personal failed\n");
30        }
31    } else {
32        echo("broker request dict failed\n");
33    }
34} else {
35    echo("broker is not a resource; failed;\n");
36}
37echo "OK\n";
38?>
39--EXPECT--
40OK
41OK
42NULL
43OK
44