com php-src: Skip these enchant tests if no dicts or providers are installed: ext/enchant/tests/broker_describe.phpt ext/enc
hant/tests/broker_list_dicts.phpt ext/enchant/tests/bug 13181.phpt

From: Date: Tue, 25 Jul 2017 20:10:34 +0000
Subject: com php-src: Skip these enchant tests if no dicts or providers are installed: ext/enchant/tests/broker_describe.phpt ext/enc
hant/tests/broker_list_dicts.phpt ext/enchant/tests/bug 13181.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98802@lists.php.net to get a copy of this message
Commit: 069477f2c1496e473c0f7b76c9b29a5549d7b517 Author: Kalle Sommer Nielsen <kalle@php.net> Tue, 25 Jul 2017 22:10:34 +0200 Parents: 73dbca198972d544e29e7cd506d396af4568a826 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=069477f2c1496e473c0f7b76c9b29a5549d7b517 Log: Skip these enchant tests if no dicts or providers are installed Changed paths: M ext/enchant/tests/broker_describe.phpt M ext/enchant/tests/broker_list_dicts.phpt M ext/enchant/tests/bug13181.phpt Diff: diff --git a/ext/enchant/tests/broker_describe.phpt b/ext/enchant/tests/broker_describe.phpt index 224902f..721d618 100644 --- a/ext/enchant/tests/broker_describe.phpt +++ b/ext/enchant/tests/broker_describe.phpt @@ -4,8 +4,25 @@ enchant_broker_describe() function marcosptf - <marcosptf@yahoo.com.br> --SKIPIF-- <?php -if(!extension_loaded('enchant')) die('skip, enchant not loader'); -if(!enchant_broker_init()) die("failed, broker_init failure\n"); +if (!extension_loaded('enchant')) { + echo "skip: Enchant extension not enabled\n"; + exit; +} + +$broker = enchant_broker_init(); + +if (!$broker) { + echo "skip: Unable to init broker\n"; + exit; +} + +if (!enchant_broker_describe($broker)) { + enchant_broker_free($broker); + + echo "skip: No broker providers found\n"; +} + +enchant_broker_free($broker); ?> --FILE-- <?php @@ -30,6 +47,8 @@ if($broker) { echo "failed, brocker describe array \n"; } + enchant_broker_free($broker); + } else { echo("failed, broker_init failure\n"); } diff --git a/ext/enchant/tests/broker_list_dicts.phpt b/ext/enchant/tests/broker_list_dicts.phpt index a634734..3b29a5d 100644 --- a/ext/enchant/tests/broker_list_dicts.phpt +++ b/ext/enchant/tests/broker_list_dicts.phpt @@ -4,8 +4,25 @@ enchant_broker_list_dicts() function marcosptf - <marcosptf@yahoo.com.br> --SKIPIF-- <?php -if(!extension_loaded('enchant')) die('skip, enchant not loader'); -if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");} +if (!extension_loaded('enchant')) { + echo "skip: Enchant extension not enabled\n"; + exit; +} + +$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 diff --git a/ext/enchant/tests/bug13181.phpt b/ext/enchant/tests/bug13181.phpt index 38aec63..79b2833 100644 --- a/ext/enchant/tests/bug13181.phpt +++ b/ext/enchant/tests/bug13181.phpt @@ -2,9 +2,26 @@ bug #13181, leaving a context frees the broker resources --SKIPIF-- <?php -if(!extension_loaded('enchant')) die('skip, enchant not loader'); +if (!extension_loaded('enchant')) { + echo "skip: Enchant extension not enabled\n"; + exit; +} + +$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_dictionnary() {

« previous php.cvs (#98802) next »