calendar_setMinimalDaysInFirstWeek_error.phpt 1.6 KB

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