mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
test refactor
refactor of this test did ten years ago, make it more resilient.
This commit is contained in:
parent
d2632efe5e
commit
55f9427688
1 changed files with 28 additions and 16 deletions
|
@ -3,26 +3,38 @@ enchant_broker_describe() function
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php
|
<?php
|
||||||
if(!extension_loaded('enchant')) die('skip, enchant not loader');
|
if(!extension_loaded('enchant')) die('skip, enchant not loader');
|
||||||
|
if(!enchant_broker_init()) die("failed, broker_init failure\n");
|
||||||
?>
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
$broker = enchant_broker_init();
|
$broker = enchant_broker_init();
|
||||||
|
|
||||||
if(!$broker) exit("failed, broker_init failure\n");
|
if($broker) {
|
||||||
|
echo("OK\n");
|
||||||
|
$provider = enchant_broker_describe($broker);
|
||||||
|
|
||||||
$provides = enchant_broker_describe($broker);
|
if (is_array($provider)) {
|
||||||
|
echo("OK\n");
|
||||||
|
|
||||||
|
foreach ($provider as $backend) {
|
||||||
|
if ((isset($backend['name']) && isset($backend['desc']) && isset($backend['file']))) {
|
||||||
|
echo("OK\n");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
echo("failed, broker describe\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
echo "failed, brocker describe array \n";
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($provides)) {
|
|
||||||
foreach ($provides as $backend) {
|
|
||||||
if (!(isset($backend['name']) && isset($backend['desc']) && isset($backend['file']))) {
|
|
||||||
exit("failed\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit("OK\n");
|
|
||||||
} else {
|
} else {
|
||||||
echo "failed";
|
echo("failed, broker_init failure\n");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECT--
|
||||||
|
OK
|
||||||
|
OK
|
||||||
OK
|
OK
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue