summaryrefslogtreecommitdiff
path: root/ext/intl/tests/timezone_hasSameRules_error.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-03-09 13:57:15 +0100
committerNikita Popov <nikic@php.net>2015-03-09 14:01:32 +0100
commit1c94ff0595bbe6f3df8058aff7252bda09dc4a15 (patch)
treeefe488bc3292d544657fca92c4347c9b872931eb /ext/intl/tests/timezone_hasSameRules_error.phpt
parent2f156c61f19a889c8ed39fe8eb3b3220555db647 (diff)
downloadphp-git-1c94ff0595bbe6f3df8058aff7252bda09dc4a15.tar.gz
Implement engine exceptions
RFC: https://wiki.php.net/rfc/engine_exceptions_for_php7 Pending changes regarding naming of BaseException and whether it should be an interface.
Diffstat (limited to 'ext/intl/tests/timezone_hasSameRules_error.phpt')
-rw-r--r--ext/intl/tests/timezone_hasSameRules_error.phpt26
1 files changed, 14 insertions, 12 deletions
diff --git a/ext/intl/tests/timezone_hasSameRules_error.phpt b/ext/intl/tests/timezone_hasSameRules_error.phpt
index 35a29be5db..102dfc9f8d 100644
--- a/ext/intl/tests/timezone_hasSameRules_error.phpt
+++ b/ext/intl/tests/timezone_hasSameRules_error.phpt
@@ -16,22 +16,24 @@ function error_handler($errno, $errstr, $errfile, $errline)
set_error_handler("error_handler");
$tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
-var_dump($tz->hasSameRules('foo'));
+try {
+ var_dump($tz->hasSameRules('foo'));
+} catch (EngineException $ex) {
+ var_dump($ex->getCode(), $ex->getMessage());
+ echo "\n";
+}
-var_dump(intltz_has_same_rules(null, $tz));
+try {
+ var_dump(intltz_has_same_rules(null, $tz));
+} catch (EngineException $ex) {
+ var_dump($ex->getCode(), $ex->getMessage());
+ echo "\n";
+}
--EXPECT--
int(4096)
string(99) "Argument 1 passed to IntlTimeZone::hasSameRules() must be an instance of IntlTimeZone, string given"
-int(2)
-string(81) "IntlTimeZone::hasSameRules() expects parameter 1 to be IntlTimeZone, string given"
-int(2)
-string(66) "IntlTimeZone::hasSameRules(): intltz_has_same_rules: bad arguments"
-bool(false)
+
int(4096)
string(92) "Argument 1 passed to intltz_has_same_rules() must be an instance of IntlTimeZone, null given"
-int(2)
-string(74) "intltz_has_same_rules() expects parameter 1 to be IntlTimeZone, null given"
-int(2)
-string(61) "intltz_has_same_rules(): intltz_has_same_rules: bad arguments"
-bool(false)
+