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