1--TEST--
2IntlTimeZone::getWindowsID 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  'America/Bogota',
14  'America/Havana',
15  'America/Indiana/Knox',
16  'America/Los_Angeles',
17  'Azeroth/Kalimdor/Durotar',
18  'Africa/Casablanca',
19  'Asia/Singapore',
20  'Australia/Perth',
21  'Europe/London',
22  'Europe/Istanbul',
23);
24
25foreach ($tzs as $tz) {
26  var_dump(IntlTimeZone::getWindowsID($tz));
27  if (intl_get_error_code() != U_ZERO_ERROR) {
28    echo "Error: ", intl_get_error_message(), "\n";
29  }
30}
31?>
32--EXPECT--
33string(24) "SA Pacific Standard Time"
34string(21) "Eastern Standard Time"
35string(21) "Central Standard Time"
36string(21) "Pacific Standard Time"
37bool(false)
38Error: intltz_get_windows_id: Unknown system timezone: U_ILLEGAL_ARGUMENT_ERROR
39string(21) "Morocco Standard Time"
40string(23) "Singapore Standard Time"
41string(26) "W. Australia Standard Time"
42string(17) "GMT Standard Time"
43string(20) "Turkey Standard Time"
44