timezone_createTimeZoneIDEnumeration_variant2.phpt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. IntlTimeZone::createTimeZoneIDEnumeration(): variant without region
  3. --EXTENSIONS--
  4. intl
  5. --FILE--
  6. <?php
  7. ini_set("intl.error_level", E_WARNING);
  8. $enum = IntlTimeZone::createTimeZoneIDEnumeration(
  9. IntlTimeZone::TYPE_ANY);
  10. $countAny = count(iterator_to_array($enum));
  11. $enum = IntlTimeZone::createTimeZoneIDEnumeration(
  12. IntlTimeZone::TYPE_CANONICAL);
  13. $countCanonical = count(iterator_to_array($enum));
  14. $enum = IntlTimeZone::createTimeZoneIDEnumeration(
  15. IntlTimeZone::TYPE_CANONICAL_LOCATION);
  16. $countCanonicalLocation = count(iterator_to_array($enum));
  17. var_dump($countAny > $countCanonical);
  18. var_dump($countCanonical > $countCanonicalLocation);
  19. $enum = IntlTimeZone::createTimeZoneIDEnumeration(
  20. IntlTimeZone::TYPE_ANY, null, null);
  21. $countAny2 = count(iterator_to_array($enum));
  22. var_dump($countAny == $countAny2);
  23. $enum = IntlTimeZone::createTimeZoneIDEnumeration(
  24. IntlTimeZone::TYPE_ANY, null, -3600000);
  25. $values = iterator_to_array($enum);
  26. print_r(
  27. array_values(
  28. array_intersect($values,
  29. array('Etc/GMT+1', 'Atlantic/Azores'))
  30. ));
  31. ?>
  32. --EXPECT--
  33. bool(true)
  34. bool(true)
  35. bool(true)
  36. Array
  37. (
  38. [0] => Atlantic/Azores
  39. [1] => Etc/GMT+1
  40. )