1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/enchant/tests/bug13181.phpt
guangwu f1a22d0943 fix: typos (#13694)
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
2024-03-13 09:30:33 +01:00

65 lines
1.1 KiB
PHP

--TEST--
bug #13181, leaving a context frees the broker resources
--EXTENSIONS--
enchant
--SKIPIF--
<?php
$broker = enchant_broker_init();
if (!$broker) {
echo "skip: Unable to init broker\n";
exit;
}
if (!enchant_broker_list_dicts($broker)) {
@enchant_broker_free($broker);
echo "skip: No broker dicts installed\n";
}
@enchant_broker_free($broker);
?>
--FILE--
<?php
function get_dictionary() {
$rBroker = enchant_broker_init();
$t = enchant_broker_request_dict($rBroker, 'en');
var_dump($t);
return $t;
}
$rDict = get_dictionary();
var_dump($rDict);
enchant_dict_suggest($rDict, "soong");
function get_broker() {
$t = enchant_broker_init();
var_dump($t);
return $t;
}
$rbroker = get_broker();
var_dump($rbroker);
function get_dict($broker) {
$t = enchant_broker_request_dict($broker, 'en');
var_dump($t);
return $t;
}
$rDict = get_dict($rbroker);
var_dump($rDict);
?>
--EXPECTF--
object(EnchantDictionary)#%d (0) {
}
object(EnchantDictionary)#%d (0) {
}
object(EnchantBroker)#%d (0) {
}
object(EnchantBroker)#%d (0) {
}
object(EnchantDictionary)#%d (0) {
}
object(EnchantDictionary)#%d (0) {
}