calendar_isWeekend_error.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. IntlCalendar::isWeekend(): 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. if (version_compare(INTL_ICU_VERSION, '4.4') < 0)
  10. die('skip for ICU 4.4+');
  11. --FILE--
  12. <?php
  13. ini_set("intl.error_level", E_WARNING);
  14. $c = new IntlGregorianCalendar(NULL, 'pt_PT');
  15. var_dump($c->isWeekend(1, 2));
  16. var_dump($c->isWeekend("jhhk"));
  17. var_dump(intlcal_is_weekend($c, "jj"));
  18. var_dump(intlcal_is_weekend(1));
  19. --EXPECTF--
  20. Warning: IntlCalendar::isWeekend(): intlcal_is_weekend: bad arguments in %s on line %d
  21. bool(false)
  22. Warning: IntlCalendar::isWeekend() expects parameter 1 to be double, string given in %s on line %d
  23. Warning: IntlCalendar::isWeekend(): intlcal_is_weekend: bad arguments in %s on line %d
  24. bool(false)
  25. Warning: intlcal_is_weekend() expects parameter 2 to be double, string given in %s on line %d
  26. Warning: intlcal_is_weekend(): intlcal_is_weekend: bad arguments in %s on line %d
  27. bool(false)
  28. Catchable fatal error: Argument 1 passed to intlcal_is_weekend() must be an instance of IntlCalendar, integer given in %s on line %d