Test Failure Report for ext/intl/tests/dateformat_get_set_calendar.phpt ('IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()')
Script
1:
<?php 2: ini_set("intl.error_level", E_WARNING); 3: ini_set("intl.default_locale", "pt_PT"); 4: ini_set("date.timezone", 'Atlantic/Azores'); 5: 6: $ts = strtotime('2012-01-01 00:00:00 UTC'); 7: 8: function d(IntlDateFormatter $df) { 9: global $ts; 10: echo $df->format($ts), "\n"; 11: var_dump($df->getCalendar(), 12: $df->getCalendarObject()->getType(), 13: $df->getCalendarObject()->getTimeZone()->getId()); 14: echo "\n"; 15: } 16: 17: $df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk'); 18: d($df); 19: 20: 21: //changing the calendar with a cal type should not change tz 22: $df->setCalendar(IntlDateFormatter::TRADITIONAL); 23: d($df); 24: 25: //but changing with an actual calendar should 26: $cal = IntlCalendar::createInstance("UTC"); 27: $df->setCalendar($cal); 28: d($df); 29: 30: ?> 31: ==DONE== 32:
Expected
dimanche 1 janvier 2012 ap. J.-C. 03:00:00 UTC+03:00
int(1)
string(9) "gregorian"
string(12) "Europe/Minsk"
dimanche 8 Safar 1433 AH 03:00:00 UTC+03:00
int(0)
string(7) "islamic"
string(12) "Europe/Minsk"
dimanche 1 janvier 2012 ap. J.-C. 00:00:00 UTC
bool(false)
string(9) "gregorian"
string(3) "UTC"
==DONE==
Output
dimanche 1 janvier 2012 02:00:00 Heure normale de l’Europe de l’Est
int(1)
string(9) "gregorian"
string(12) "Europe/Minsk"
dimanche 8 Safar 1433 02:00:00 Heure normale de l’Europe de l’Est
int(0)
string(7) "islamic"
string(12) "Europe/Minsk"
dimanche 1 janvier 2012 00:00:00 UTC+00:00
bool(false)
string(9) "gregorian"
string(3) "UTC"
==DONE==
Diff
001+ dimanche 1 janvier 2012 02:00:00 Heure normale de l’Europe de l’Est
001- dimanche 1 janvier 2012 ap. J.-C. 03:00:00 UTC+03:00
006+ dimanche 8 Safar 1433 02:00:00 Heure normale de l’Europe de l’Est
006- dimanche 8 Safar 1433 AH 03:00:00 UTC+03:00
011+ dimanche 1 janvier 2012 00:00:00 UTC+00:00
011- dimanche 1 janvier 2012 ap. J.-C. 00:00:00 UTC
Generated at Thu, 23 May 2013 18:18:24 +0000 (2 days ago)
|