timezone_getDisplayName_variant2-49+.phpt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. IntlTimeZone::getDisplayName(): type parameter (ICU >= 49 && ICU < 51.2)
  3. --SKIPIF--
  4. <?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
  5. <?php if (version_compare(INTL_ICU_VERSION, '49') < 0) die('skip for ICU 49+'); ?>
  6. <?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. ini_set("error_reporting", -1);
  11. ini_set("display_errors", 1);
  12. $lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
  13. ini_set('intl.default_locale', 'en_US');
  14. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT));
  15. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG));
  16. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GENERIC));
  17. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GENERIC));
  18. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_GMT));
  19. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG_GMT));
  20. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_SHORT_COMMONLY_USED));
  21. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_GENERIC_LOCATION));
  22. ?>
  23. ==DONE==
  24. --EXPECT--
  25. string(3) "GMT"
  26. string(30) "Western European Standard Time"
  27. string(22) "Portugal Time (Lisbon)"
  28. string(21) "Western European Time"
  29. string(5) "+0000"
  30. string(3) "GMT"
  31. string(3) "GMT"
  32. string(22) "Portugal Time (Lisbon)"
  33. ==DONE==