1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/intl/tests/gregoriancalendar___construct_basic.phpt
Gina Peter Banyard c42e6d62d8 ext/intl: modernize tests (#19392)
This is effectively removing ZPP tests, enabling warnings, and moving INI settings into the INI PHPT block
2025-08-06 23:33:48 +01:00

48 lines
1.6 KiB
PHP

--TEST--
IntlGregorianCalendar::__construct(): basic
--EXTENSIONS--
intl
--INI--
date.timezone=Europe/Amsterdam
intl.default_locale=nl
--FILE--
<?php
$intlcal = intlgregcal_create_instance();
var_dump($intlcal->getTimeZone()->getId());
var_dump($intlcal->getLocale(1));
$intlcal = new IntlGregorianCalendar('Europe/Lisbon', NULL);
var_dump($intlcal->getTimeZone()->getId());
var_dump($intlcal->getLocale(1));
$intlcal = new IntlGregorianCalendar(NULL, 'pt_PT');
var_dump($intlcal->getTimeZone()->getId());
var_dump($intlcal->getLocale(1));
$intlcal = new IntlGregorianCalendar('Europe/Lisbon', 'pt_PT');
var_dump($intlcal->getTimeZone()->getId());
var_dump($intlcal->getLocale(1));
$intlcal = new IntlGregorianCalendar('Europe/Paris', 'fr_CA', NULL, NULL, NULL, NULL);
var_dump($intlcal->getTimeZone()->getId());
var_dump($intlcal->getLocale(1));
var_dump($intlcal->getType());
?>
--EXPECTF--
Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
string(16) "Europe/Amsterdam"
string(5) "nl_NL"
string(13) "Europe/Lisbon"
string(5) "nl_NL"
string(16) "Europe/Amsterdam"
string(5) "pt_PT"
string(13) "Europe/Lisbon"
string(5) "pt_PT"
Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
string(12) "Europe/Paris"
string(5) "fr_CA"
string(9) "gregorian"