summaryrefslogtreecommitdiff
path: root/ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2012-04-01 11:11:40 +0200
committerGustavo André dos Santos Lopes <cataphract@php.net>2012-04-01 23:28:00 +0100
commit5e65205a8f52d25635bb4e7619a4b0216aefa4b8 (patch)
tree5c9984f097fe230ad52dbd48ad8895056c108960 /ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt
parent6c891f33d73afc50c3d79e982c5752fc3f5df85f (diff)
downloadphp-git-5e65205a8f52d25635bb4e7619a4b0216aefa4b8.tar.gz
Initial checkin of calendar/timezone code.
Diffstat (limited to 'ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt')
-rw-r--r--ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt31
1 files changed, 31 insertions, 0 deletions
diff --git a/ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt b/ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt
new file mode 100644
index 0000000000..d3a3dee47d
--- /dev/null
+++ b/ext/intl/tests/timezone_getErrorCodeMessage_basic.phpt
@@ -0,0 +1,31 @@
+--TEST--
+IntlTimeZone::getErrorCode/Message(): basic test
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
+
+var_dump($lsb->getErrorCode());
+var_dump($lsb->getErrorMessage());
+
+var_dump($lsb->getOffset(INF, 1, $a, $b));
+
+var_dump($lsb->getErrorCode());
+var_dump($lsb->getErrorMessage());
+
+?>
+==DONE==
+--EXPECTF--
+int(0)
+string(12) "U_ZERO_ERROR"
+
+Warning: IntlTimeZone::getOffset(): intltz_get_offset: error obtaining offset in %s on line %d
+bool(false)
+int(1)
+string(67) "intltz_get_offset: error obtaining offset: U_ILLEGAL_ARGUMENT_ERROR"
+==DONE== \ No newline at end of file