calendar_setTime_error.phpt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. IntlCalendar::setTime(): bad arguments
  3. --INI--
  4. date.timezone=Atlantic/Azores
  5. --SKIPIF--
  6. <?php
  7. if (!extension_loaded('intl'))
  8. die('skip intl extension not enabled');
  9. --FILE--
  10. <?php
  11. ini_set("intl.error_level", E_WARNING);
  12. $c = new IntlGregorianCalendar(NULL, 'pt_PT');
  13. var_dump($c->setTime(1, 2));
  14. var_dump($c->setTime("jjj"));
  15. var_dump(intlcal_set_time($c, 1, 2));
  16. var_dump(intlcal_set_time(1));
  17. --EXPECTF--
  18. Warning: IntlCalendar::setTime() expects exactly 1 parameter, 2 given in %s on line %d
  19. Warning: IntlCalendar::setTime(): intlcal_set_time: bad arguments in %s on line %d
  20. bool(false)
  21. Warning: IntlCalendar::setTime() expects parameter 1 to be float, string given in %s on line %d
  22. Warning: IntlCalendar::setTime(): intlcal_set_time: bad arguments in %s on line %d
  23. bool(false)
  24. Warning: intlcal_set_time() expects exactly 2 parameters, 3 given in %s on line %d
  25. Warning: intlcal_set_time(): intlcal_set_time: bad arguments in %s on line %d
  26. bool(false)
  27. Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_set_time() must be an instance of IntlCalendar, int given in %s:%d
  28. Stack trace:
  29. #0 %s(%d): intlcal_set_time(1)
  30. #1 {main}
  31. thrown in %s on line %d