calendar_getMinimalDaysInFirstWeek_error.phpt 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. IntlCalendar::getMinimalDaysInFirstWeek(): 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->getMinimalDaysInFirstWeek(1));
  14. var_dump(intlcal_get_minimal_days_in_first_week($c, 1));
  15. var_dump(intlcal_get_minimal_days_in_first_week(1));
  16. --EXPECTF--
  17. Warning: IntlCalendar::getMinimalDaysInFirstWeek() expects exactly 0 parameters, 1 given in %s on line %d
  18. Warning: IntlCalendar::getMinimalDaysInFirstWeek(): intlcal_get_minimal_days_in_first_week: bad arguments in %s on line %d
  19. bool(false)
  20. Warning: intlcal_get_minimal_days_in_first_week() expects exactly 1 parameter, 2 given in %s on line %d
  21. Warning: intlcal_get_minimal_days_in_first_week(): intlcal_get_minimal_days_in_first_week: bad arguments in %s on line %d
  22. bool(false)
  23. Fatal error: Uncaught TypeError: Argument 1 passed to intlcal_get_minimal_days_in_first_week() must be an instance of IntlCalendar, int given in %s:%d
  24. Stack trace:
  25. #0 %s(%d): intlcal_get_minimal_days_in_first_week(1)
  26. #1 {main}
  27. thrown in %s on line %d