1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00
Files
archived-php-src/ext/intl/tests/timezone_hasSameRules_error.phpt
T
Nikita Popov c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00

39 lines
915 B
PHP

--TEST--
IntlTimeZone::hasSameRules(): errors
--SKIPIF--
<?php
if (!extension_loaded('intl'))
die('skip intl extension not enabled');
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
function error_handler($errno, $errstr, $errfile, $errline)
{
var_dump($errno, $errstr);
return true;
}
set_error_handler("error_handler");
$tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
try {
var_dump($tz->hasSameRules('foo'));
} catch (Error $ex) {
var_dump($ex->getCode(), $ex->getMessage());
echo "\n";
}
try {
var_dump(intltz_has_same_rules(null, $tz));
} catch (Error $ex) {
var_dump($ex->getCode(), $ex->getMessage());
echo "\n";
}
?>
--EXPECT--
int(0)
string(101) "IntlTimeZone::hasSameRules(): Argument #1 ($otherTimeZone) must be of type IntlTimeZone, string given"
int(0)
string(83) "intltz_has_same_rules(): Argument #1 ($tz) must be of type IntlTimeZone, null given"