1--TEST--
2enchant_broker_free_dict(resource $dict); 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 = "iLoveJava";
17if (is_object($broker)) {
18    echo("OK\n");
19    $requestDict = enchant_broker_request_dict($broker, $dicts[0]['lang_tag']);
20
21    if ($requestDict) {
22        echo("OK\n");
23        $AddtoPersonalDict = enchant_dict_add($requestDict, $newWord);
24
25        if (NULL === $AddtoPersonalDict) {
26            var_dump($AddtoPersonalDict);
27
28            if (enchant_broker_free_dict($requestDict)) {
29                echo("OK\n");
30
31            } else {
32                echo("dict broker free has failed\n");
33            }
34
35        } else {
36            echo("dict add to personal failed\n");
37        }
38
39    } else {
40        echo("broker request dict failed\n");
41    }
42
43} else {
44    echo("broker is not a resource; failed;\n");
45}
46echo "OK\n";
47?>
48--EXPECTF--
49OK
50OK
51NULL
52
53Deprecated: Function enchant_broker_free_dict() is deprecated in %s
54OK
55OK
56