calendar_equals_error.phpt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. IntlCalendar::equals(): 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. function eh($errno, $errstr) {
  14. echo "error: $errno, $errstr\n";
  15. }
  16. set_error_handler('eh');
  17. var_dump($c->equals());
  18. var_dump($c->equals(new stdclass));
  19. var_dump($c->equals(1, 2));
  20. var_dump(intlcal_equals($c, array()));
  21. var_dump(intlcal_equals(1, $c));
  22. --EXPECT--
  23. error: 2, IntlCalendar::equals() expects exactly 1 parameter, 0 given
  24. error: 2, IntlCalendar::equals(): intlcal_equals: bad arguments
  25. bool(false)
  26. error: 4096, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, instance of stdClass given
  27. error: 2, IntlCalendar::equals() expects parameter 1 to be IntlCalendar, object given
  28. error: 2, IntlCalendar::equals(): intlcal_equals: bad arguments
  29. bool(false)
  30. error: 4096, Argument 1 passed to IntlCalendar::equals() must be an instance of IntlCalendar, integer given
  31. error: 2, IntlCalendar::equals() expects exactly 1 parameter, 2 given
  32. error: 2, IntlCalendar::equals(): intlcal_equals: bad arguments
  33. bool(false)
  34. error: 4096, Argument 2 passed to intlcal_equals() must be an instance of IntlCalendar, array given
  35. error: 2, intlcal_equals() expects parameter 2 to be IntlCalendar, array given
  36. error: 2, intlcal_equals(): intlcal_equals: bad arguments
  37. bool(false)
  38. error: 4096, Argument 1 passed to intlcal_equals() must be an instance of IntlCalendar, integer given
  39. error: 2, intlcal_equals() expects parameter 1 to be IntlCalendar, integer given
  40. error: 2, intlcal_equals(): intlcal_equals: bad arguments
  41. bool(false)