1--TEST-- 2proto bool enchant_broker_set_dict_path(resource broker, int dict_type, string value) function 3proto string enchant_broker_get_dict_path(resource broker, int dict_type) function 4--CREDITS-- 5marcosptf - <marcosptf@yahoo.com.br> 6--SKIPIF-- 7<?php 8if(!extension_loaded('enchant')) die('skip, enchant not loader'); 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");} 11if (defined("LIBENCHANT_VERSION") && version_compare(LIBENCHANT_VERSION, "2", ">")) die('skip libenchant v1 only'); 12?> 13--FILE-- 14<?php 15$broker = enchant_broker_init(); 16$backEndDictType1 = "MYSPELL"; 17$backEndDictType2 = "ISPELL"; 18$dictTypeValue1 = 1; 19$dictTypeValue2 = 2; 20 21if (is_object($broker)) { 22 echo("OK\n"); 23 24 if (enchant_broker_set_dict_path($broker, $dictTypeValue1, $backEndDictType1)) { 25 echo("OK\n"); 26 27 if (enchant_broker_set_dict_path($broker, $dictTypeValue2, $backEndDictType2)) { 28 echo("OK\n"); 29 30 if ( 31 (enchant_broker_get_dict_path($broker,$dictTypeValue1) == $backEndDictType1) && 32 (enchant_broker_get_dict_path($broker,$dictTypeValue2) == $backEndDictType2) 33 ) { 34 echo("OK\n"); 35 36 } else { 37 echo("broker get dict path has failed \n"); 38 } 39 40 } else { 41 echo("broker set dict path {$backEndDictType2} has failed \n"); 42 } 43 } else { 44 echo("broker set dict path {$backEndDictType1} has failed \n"); 45 } 46} else { 47 echo("broker is not a resource; failed; \n"); 48} 49?> 50--EXPECTF-- 51OK 52 53Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s 54OK 55 56Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s 57OK 58 59Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s 60 61Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s 62OK 63