1--TEST--
2IntlTimeZone::getIDForWindowsID basic test
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6    die('skip intl extension not enabled'); ?>
7<?php if (version_compare(INTL_ICU_VERSION, '52') < 0)die('skip for ICU >= 52'); ?>
8<?php if (version_compare(INTL_ICU_VERSION, '58.1') >= 0) die('skip for ICU <= 57.1'); ?>
9--FILE--
10<?php
11
12$tzs = array(
13  'Gnomeregan' => array(NULL),
14  'India Standard Time' => array(NULL),
15  'Pacific Standard Time' => array('001', 'CA', 'MX', 'US', 'ZZ'),
16  'Romance Standard Time' => array('001', 'BE', 'DK', 'ES', 'FR'),
17);
18
19foreach ($tzs as $tz => $regions) {
20  echo "** $tz\n";
21  foreach ($regions as $region) {
22    var_dump(IntlTimeZone::getIDForWindowsID($tz, $region));
23    if (intl_get_error_code() != U_ZERO_ERROR) {
24      echo "Error: ", intl_get_error_message(), "\n";
25    }
26  }
27}
28?>
29--EXPECT--
30** Gnomeregan
31bool(false)
32Error: intltz_get_windows_id: Unknown windows timezone: U_ILLEGAL_ARGUMENT_ERROR
33** India Standard Time
34string(13) "Asia/Calcutta"
35** Pacific Standard Time
36string(19) "America/Los_Angeles"
37string(17) "America/Vancouver"
38string(15) "America/Tijuana"
39string(19) "America/Los_Angeles"
40string(7) "PST8PDT"
41** Romance Standard Time
42string(12) "Europe/Paris"
43string(15) "Europe/Brussels"
44string(17) "Europe/Copenhagen"
45string(13) "Europe/Madrid"
46string(12) "Europe/Paris"
47