1--TEST--
2enchant_dict_is_in_session() function
3--CREDITS--
4marcosptf - <marcosptf@yahoo.com.br>
5--SKIPIF--
6<?php
7if(!extension_loaded('enchant')) die('skip, enchant not loader');
8if (!is_object(enchant_broker_init())) {die("skip, resource dont load\n");}
9if (!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, no dictionary installed on this machine! \n");}
10?>
11--FILE--
12<?php
13$broker = enchant_broker_init();
14$dicts = enchant_broker_list_dicts($broker);
15$newWord = "aspell";
16
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(enchant_dict_is_added($requestDict,$newWord));
27        } else {
28            echo("dict add to personal failed\n");
29        }
30    } else {
31        echo("broker request dict failed\n");
32    }
33} else {
34    echo("broker is not a resource; failed;\n");
35}
36echo("OK\n");
37?>
38--EXPECT--
39OK
40OK
41bool(true)
42OK
43