timezone_getDisplayName_variant3-49+.phpt 920 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. IntlTimeZone::getDisplayName(): locale parameter
  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, '55.1') >= 0) die('skip for ICU < 55.1'); ?>
  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_LONG));
  15. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, NULL));
  16. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, 'pt_PT'));
  17. ?>
  18. ==DONE==
  19. --EXPECT--
  20. string(30) "Western European Standard Time"
  21. string(30) "Western European Standard Time"
  22. string(32) "Hora Padrão da Europa Ocidental"
  23. ==DONE==