timezone_getErrorCodeMessage_basic.phpt 700 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. IntlTimeZone::getErrorCode/Message(): basic test
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. $lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
  11. var_dump($lsb->getErrorCode());
  12. var_dump($lsb->getErrorMessage());
  13. var_dump($lsb->getOffset(INF, 1, $a, $b));
  14. var_dump($lsb->getErrorCode());
  15. var_dump($lsb->getErrorMessage());
  16. ?>
  17. ==DONE==
  18. --EXPECTF--
  19. int(0)
  20. string(12) "U_ZERO_ERROR"
  21. Warning: IntlTimeZone::getOffset(): intltz_get_offset: error obtaining offset in %s on line %d
  22. bool(false)
  23. int(1)
  24. string(67) "intltz_get_offset: error obtaining offset: U_ILLEGAL_ARGUMENT_ERROR"
  25. ==DONE==