diff options
author | marcosptf <marcosptf@yahoo.com.br> | 2015-08-09 07:17:30 -0300 |
---|---|---|
committer | marcosptf <marcosptf@yahoo.com.br> | 2015-08-09 07:17:30 -0300 |
commit | 55f9427688f35309696751a13f9ba6d4e134e6cc (patch) | |
tree | a2a0cd4d7ae2c9628d07280d212921e2d4f084c2 /ext/enchant/tests | |
parent | d2632efe5e95b3e6dafca435847e10fac136c75f (diff) | |
download | php-git-55f9427688f35309696751a13f9ba6d4e134e6cc.tar.gz |
test refactor
refactor of this test did ten years ago, make it more resilient.
Diffstat (limited to 'ext/enchant/tests')
-rw-r--r-- | ext/enchant/tests/broker_describe.phpt | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/ext/enchant/tests/broker_describe.phpt b/ext/enchant/tests/broker_describe.phpt index 4c03f6f4dd..f24a9c0cb7 100644 --- a/ext/enchant/tests/broker_describe.phpt +++ b/ext/enchant/tests/broker_describe.phpt @@ -1,28 +1,40 @@ --TEST-- enchant_broker_describe() function --SKIPIF-- -<?php +<?php if(!extension_loaded('enchant')) die('skip, enchant not loader'); - - ?> +if(!enchant_broker_init()) die("failed, broker_init failure\n"); +?> --FILE-- <?php $broker = enchant_broker_init(); -if(!$broker) exit("failed, broker_init failure\n"); - -$provides = enchant_broker_describe($broker); - -if (is_array($provides)) { - foreach ($provides as $backend) { - if (!(isset($backend['name']) && isset($backend['desc']) && isset($backend['file']))) { - exit("failed\n"); - } - } - exit("OK\n"); +if($broker) { + echo("OK\n"); + $provider = 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"; + } + } else { - echo "failed"; + echo("failed, broker_init failure\n"); } ?> ---EXPECTF-- +--EXPECT-- +OK +OK OK |