calendar_fieldDifference_error.phpt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --TEST--
  2. IntlCalendar::fieldDifference(): 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->fieldDifference($c, 2, 3));
  14. var_dump($c->fieldDifference(INF, 2));
  15. var_dump($c->fieldDifference(1));
  16. var_dump(intlcal_field_difference($c, 0, 1, 2));
  17. var_dump(intlcal_field_difference(1, 0, 1));
  18. --EXPECTF--
  19. Warning: IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given in %s on line %d
  20. Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: bad arguments in %s on line %d
  21. bool(false)
  22. Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d
  23. bool(false)
  24. Warning: IntlCalendar::fieldDifference() expects exactly 2 parameters, 1 given in %s on line %d
  25. Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: bad arguments in %s on line %d
  26. bool(false)
  27. Warning: intlcal_field_difference() expects exactly 3 parameters, 4 given in %s on line %d
  28. Warning: intlcal_field_difference(): intlcal_field_difference: bad arguments in %s on line %d
  29. bool(false)
  30. Catchable fatal error: Argument 1 passed to intlcal_field_difference() must be an instance of IntlCalendar, integer given in %s on line %d