timezone_getDisplayName_error.phpt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --TEST--
  2. IntlTimeZone::getDisplayName(): errors
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. $tz = IntlTimeZone::createTimeZone('Europe/Lisbon');
  11. var_dump($tz->getDisplayName(array()));
  12. var_dump($tz->getDisplayName(false, array()));
  13. var_dump($tz->getDisplayName(false, -1));
  14. var_dump($tz->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT, array()));
  15. var_dump($tz->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT, NULL, NULL));
  16. var_dump(intltz_get_display_name(null, IntlTimeZone::DISPLAY_SHORT, false, 'pt_PT'));
  17. --EXPECTF--
  18. Warning: IntlTimeZone::getDisplayName() expects parameter 1 to be boolean, array given in %s on line %d
  19. Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d
  20. bool(false)
  21. Warning: IntlTimeZone::getDisplayName() expects parameter 2 to be long, array given in %s on line %d
  22. Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d
  23. bool(false)
  24. Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: wrong display type in %s on line %d
  25. bool(false)
  26. Warning: IntlTimeZone::getDisplayName() expects parameter 3 to be string, array given in %s on line %d
  27. Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d
  28. bool(false)
  29. Warning: IntlTimeZone::getDisplayName() expects at most 3 parameters, 4 given in %s on line %d
  30. Warning: IntlTimeZone::getDisplayName(): intltz_get_display_name: bad arguments in %s on line %d
  31. bool(false)
  32. Catchable fatal error: Argument 1 passed to intltz_get_display_name() must be an instance of IntlTimeZone, null given in %s on line %d