calendar_setTimeZone_error2.phpt 995 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. IntlCalendar::setTimeZone(): valid time zones for DateTime but not ICU
  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. ini_set("intl.default_locale", "nl");
  11. date_default_timezone_set('Europe/Amsterdam');
  12. $intlcal = new IntlGregorianCalendar();
  13. $pstdate = new DateTime('2012-01-01 00:00:00 WEST');
  14. $intlcal->setTimeZone($pstdate->getTimeZone());
  15. var_dump($intlcal->getTimeZone()->getID());
  16. $pstdate = new DateTime('2012-01-01 00:00:00 +24:00');
  17. $intlcal->setTimeZone($pstdate->getTimeZone());
  18. var_dump($intlcal->getTimeZone()->getID());
  19. --EXPECTF--
  20. Warning: IntlCalendar::setTimeZone(): intlcal_set_time_zone: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d
  21. string(16) "Europe/Amsterdam"
  22. Warning: IntlCalendar::setTimeZone(): intlcal_set_time_zone: object has an time zone offset that's too large in %s on line %d
  23. string(16) "Europe/Amsterdam"