1--TEST--
2IntlCalendar::get/setSkippedWallTimeOption(): basic test
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7ini_set("intl.error_level", E_WARNING);
8ini_set("intl.default_locale", "nl");
9
10date_default_timezone_set('Europe/Amsterdam');
11
12//25 March 2012, transition to DST
13$intlcal = new IntlGregorianCalendar(2012, 2, 25, 0, 0, 0);
14var_dump($intlcal->getSkippedWallTimeOption());
15$intlcal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 2);
16$intlcal->set(IntlCalendar::FIELD_MINUTE, 30);
17echo "Should be 3h30\n";
18var_dump(
19    $intlcal->get(IntlCalendar::FIELD_HOUR_OF_DAY),
20    $intlcal->get(IntlCalendar::FIELD_MINUTE)
21);
22
23var_dump($intlcal->setSkippedWallTimeOption(IntlCalendar::WALLTIME_FIRST));
24var_dump(intlcal_get_skipped_wall_time_option($intlcal));
25$intlcal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 2);
26$intlcal->set(IntlCalendar::FIELD_MINUTE, 30);
27echo "Should be 1h30\n";
28var_dump(
29    $intlcal->get(IntlCalendar::FIELD_HOUR_OF_DAY),
30    $intlcal->get(IntlCalendar::FIELD_MINUTE)
31);
32
33var_dump(intlcal_set_skipped_wall_time_option($intlcal, IntlCalendar::WALLTIME_NEXT_VALID));
34var_dump($intlcal->getSkippedWallTimeOption());
35$intlcal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 2);
36$intlcal->set(IntlCalendar::FIELD_MINUTE, 30);
37echo "Should be 3h00\n";
38var_dump(
39    $intlcal->get(IntlCalendar::FIELD_HOUR_OF_DAY),
40    $intlcal->get(IntlCalendar::FIELD_MINUTE)
41);
42
43
44?>
45--EXPECTF--
46Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
47int(0)
48Should be 3h30
49int(3)
50int(30)
51bool(true)
52int(1)
53Should be 1h30
54int(1)
55int(30)
56bool(true)
57int(2)
58Should be 3h00
59int(3)
60int(0)
61