timezone_useDaylightTime_error.phpt 768 B

123456789101112131415161718192021222324
  1. --TEST--
  2. IntlTimeZone::useDaylightTime(): errors
  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. $tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
  11. var_dump($tz->useDaylightTime('foo'));
  12. intltz_use_daylight_time(null);
  13. --EXPECTF--
  14. Warning: IntlTimeZone::useDaylightTime() expects exactly 0 parameters, 1 given in %s on line %d
  15. Warning: IntlTimeZone::useDaylightTime(): intltz_use_daylight_time: bad arguments in %s on line %d
  16. bool(false)
  17. Fatal error: Uncaught TypeError: Argument 1 passed to intltz_use_daylight_time() must be an instance of IntlTimeZone, null given in %s:%d
  18. Stack trace:
  19. #0 %s(%d): intltz_use_daylight_time(NULL)
  20. #1 {main}
  21. thrown in %s on line %d