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_resource(enchant_broker_init())) {die("skip, resource dont load\n");} 10if (!is_array(enchant_broker_list_dicts(enchant_broker_init()))) {die("skip, dont has dictionary install in this machine! \n");} 11?> 12--FILE-- 13<?php 14$broker = enchant_broker_init(); 15$backEndDictType1 = "MYSPELL"; 16$backEndDictType2 = "ISPELL"; 17$dictTypeValue1 = 1; 18$dictTypeValue2 = 2; 19 20if (is_resource($broker)) { 21 echo("OK\n"); 22 23 if (enchant_broker_set_dict_path($broker, $dictTypeValue1, $backEndDictType1)) { 24 echo("OK\n"); 25 26 if (enchant_broker_set_dict_path($broker, $dictTypeValue2, $backEndDictType2)) { 27 echo("OK\n"); 28 29 if ( 30 (enchant_broker_get_dict_path($broker,$dictTypeValue1) == $backEndDictType1) && 31 (enchant_broker_get_dict_path($broker,$dictTypeValue2) == $backEndDictType2) 32 ) { 33 echo("OK\n"); 34 35 } else { 36 echo("broker get dict path has failed \n"); 37 } 38 39 } else { 40 echo("broker set dict path {$backEndDictType2} has failed \n"); 41 } 42 } else { 43 echo("broker set dict path {$backEndDictType1} has failed \n"); 44 } 45} else { 46 echo("broker is not a resource; failed; \n"); 47} 48?> 49--EXPECT-- 50OK 51OK 52OK 53OK 54