diff options
39 files changed, 37 insertions, 80 deletions
diff --git a/ext/date/tests/003.phpt b/ext/date/tests/003.phpt index 621a87b341..2be6cf773d 100644 --- a/ext/date/tests/003.phpt +++ b/ext/date/tests/003.phpt @@ -1,9 +1,8 @@ --TEST-- date suffixes test ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); for ($i = 0; $i < 32; $i++) { var_dump(date("jS", mktime(0,0,0, 1, $i, 2006))); diff --git a/ext/date/tests/005.phpt b/ext/date/tests/005.phpt index c6551b76b4..911aea7791 100644 --- a/ext/date/tests/005.phpt +++ b/ext/date/tests/005.phpt @@ -1,9 +1,8 @@ --TEST-- idate() and invalid params ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $t = mktime(0,0,0, 6, 27, 2006); diff --git a/ext/date/tests/006.phpt b/ext/date/tests/006.phpt index 407242b161..19a044a91e 100644 --- a/ext/date/tests/006.phpt +++ b/ext/date/tests/006.phpt @@ -1,9 +1,8 @@ --TEST-- checkdate() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); var_dump(checkdate()); var_dump(checkdate(1,1,1)); diff --git a/ext/date/tests/007.phpt b/ext/date/tests/007.phpt index f0c8784659..567777e106 100644 --- a/ext/date/tests/007.phpt +++ b/ext/date/tests/007.phpt @@ -1,9 +1,8 @@ --TEST-- localtime() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $t = mktime(0,0,0, 6, 27, 2006); var_dump(localtime(1,1,1)); diff --git a/ext/date/tests/008.phpt b/ext/date/tests/008.phpt index 424e156783..ce6be18556 100644 --- a/ext/date/tests/008.phpt +++ b/ext/date/tests/008.phpt @@ -1,9 +1,8 @@ --TEST-- getdate() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $t = mktime(0,0,0, 6, 27, 2006); var_dump(getdate(1,1)); diff --git a/ext/date/tests/009.phpt b/ext/date/tests/009.phpt index a41383205b..3697ed61f5 100644 --- a/ext/date/tests/009.phpt +++ b/ext/date/tests/009.phpt @@ -1,7 +1,5 @@ --TEST-- strftime() and gmstrftime() tests ---INI-- -date.timezone=Asia/Jerusalem --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) == 'WIN') die('skip posix only test.'); @@ -9,6 +7,7 @@ if (!function_exists('strftime')) die("skip, strftime not available"); ?> --FILE-- <?php +date_default_timezone_set('Asia/Jerusalem'); $t = mktime(0,0,0, 6, 27, 2006); diff --git a/ext/date/tests/009_win32.phpt b/ext/date/tests/009_win32.phpt index 3c22604b3c..6121f625b4 100644 --- a/ext/date/tests/009_win32.phpt +++ b/ext/date/tests/009_win32.phpt @@ -1,7 +1,5 @@ --TEST-- strftime() and gmstrftime() tests ---INI-- -date.timezone=Asia/Jerusalem --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) != 'WIN') die('skip only windows test.'); @@ -9,6 +7,7 @@ if (!function_exists('strftime')) die("skip, strftime not available"); ?> --FILE-- <?php +date_default_timezone_set('Asia/Jerusalem'); $t = mktime(0,0,0, 6, 27, 2006); diff --git a/ext/date/tests/010.phpt b/ext/date/tests/010.phpt index 3cba29f01b..74b2b060e0 100644 --- a/ext/date/tests/010.phpt +++ b/ext/date/tests/010.phpt @@ -1,9 +1,8 @@ --TEST-- timezone_abbreviations_list() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $timezone_abbreviations = timezone_abbreviations_list(); var_dump($timezone_abbreviations["est"]); echo "Done\n"; diff --git a/ext/date/tests/011.phpt b/ext/date/tests/011.phpt index 1302f1d212..460e8c9d8e 100644 --- a/ext/date/tests/011.phpt +++ b/ext/date/tests/011.phpt @@ -1,9 +1,8 @@ --TEST-- timezone_name_from_abbr() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); var_dump(timezone_name_from_abbr()); var_dump(timezone_name_from_abbr("CET")); @@ -14,7 +13,7 @@ var_dump(timezone_name_from_abbr("", 3600, 0)); echo "Done\n"; ?> --EXPECTF-- -Warning: timezone_name_from_abbr() expects at least 1 parameter, 0 given in %s on line 3 +Warning: timezone_name_from_abbr() expects at least 1 parameter, 0 given in %s on line %d bool(false) string(13) "Europe/Berlin" bool(false) diff --git a/ext/date/tests/012.phpt b/ext/date/tests/012.phpt index d16983bc06..0577f18233 100644 --- a/ext/date/tests/012.phpt +++ b/ext/date/tests/012.phpt @@ -1,9 +1,8 @@ --TEST-- date_isodate_set() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $dto = date_create("2006-12-12"); var_dump(date_isodate_set($dto, 2006, 2, 15)); diff --git a/ext/date/tests/013.phpt b/ext/date/tests/013.phpt index f374142058..60fac24f6e 100644 --- a/ext/date/tests/013.phpt +++ b/ext/date/tests/013.phpt @@ -1,9 +1,8 @@ --TEST-- date_date_set() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $dto = date_create("2006-12-12"); var_dump($dto); diff --git a/ext/date/tests/014.phpt b/ext/date/tests/014.phpt index 05be2e3988..be0847777f 100644 --- a/ext/date/tests/014.phpt +++ b/ext/date/tests/014.phpt @@ -1,9 +1,8 @@ --TEST-- timezone_offset_get() tests ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $dto = date_create("2006-12-12"); var_dump($dto); diff --git a/ext/date/tests/015.phpt b/ext/date/tests/015.phpt index 006b5b16a8..46001ad8f0 100644 --- a/ext/date/tests/015.phpt +++ b/ext/date/tests/015.phpt @@ -1,9 +1,8 @@ --TEST-- timezone object reference handling ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $dto = new DateTime(); $tzold = $dto->getTimezone(); var_dump($tzold->getName()); diff --git a/ext/date/tests/bug36988.phpt b/ext/date/tests/bug36988.phpt index d35e58939a..c37d1fb768 100644 --- a/ext/date/tests/bug36988.phpt +++ b/ext/date/tests/bug36988.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #36988 (mktime freezes on long numbers) ---INI-- -date.timezone=GMT --FILE-- <?php +date_default_timezone_set('GMT'); $start = microtime(true); $a = mktime(1, 1, 1, 1, 1, 11111111111); echo (microtime(true) - $start) < 1 ? "smaller than one second" : "more than a second"; diff --git a/ext/date/tests/bug37017.phpt b/ext/date/tests/bug37017.phpt index 61dc8ba383..6336e71976 100644 --- a/ext/date/tests/bug37017.phpt +++ b/ext/date/tests/bug37017.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #37017 (strtotime fails before 13:00:00 with some time zones identifiers). ---INI-- -date.timezone=GMT --FILE-- <?php +date_default_timezone_set('GMT'); echo strtotime("2006-05-12 13:00:01 America/New_York"), "\n"; echo strtotime("2006-05-12 13:00:00 America/New_York"), "\n"; echo strtotime("2006-05-12 12:59:59 America/New_York"), "\n"; diff --git a/ext/date/tests/bug37368.phpt b/ext/date/tests/bug37368.phpt index 5be1c96798..7f526a48d0 100644 --- a/ext/date/tests/bug37368.phpt +++ b/ext/date/tests/bug37368.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #37368 (Incorrect timestamp returned for strtotime()). ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); echo date("r", strtotime("Mon, 08 May 2006 13:06:44 -0400 +30 days")); ?> --EXPECT-- diff --git a/ext/date/tests/bug37514.phpt b/ext/date/tests/bug37514.phpt index abbb4407c8..fbde5e2f5d 100644 --- a/ext/date/tests/bug37514.phpt +++ b/ext/date/tests/bug37514.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #37514 (strtotime doesn't assume year correctly). ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); echo date('r', strtotime('May 18th 5:05', 1168156376)), "\n"; echo date('r', strtotime('May 18th 5:05pm', 1168156376)), "\n"; echo date('r', strtotime('May 18th 5:05 pm', 1168156376)), "\n"; diff --git a/ext/date/tests/bug43075.phpt b/ext/date/tests/bug43075.phpt index 864147ace7..e33a3bcc1f 100644 --- a/ext/date/tests/bug43075.phpt +++ b/ext/date/tests/bug43075.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #43075 (Support 24 as hour) ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $d = date_create("2007-11-01T24:34:00+00:00"); echo $d->format("c"); ?> diff --git a/ext/date/tests/bug43452.phpt b/ext/date/tests/bug43452.phpt index 25b4f0161a..8780474f59 100644 --- a/ext/date/tests/bug43452.phpt +++ b/ext/date/tests/bug43452.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #43452 ("weekday" is not equivalent to "1 weekday" of the current weekday is "weekday") ---INI-- -date.timezone=Europe/Oslo --FILE-- <?php +date_default_timezone_set('Europe/Oslo'); // <day> is equivalent to 1 <day> and will *not* forward if the current day // (November 1st) is the same day of week. $day = strtotime( "Thursday Nov 2007" ); diff --git a/ext/date/tests/bug43960.phpt b/ext/date/tests/bug43960.phpt index 10cbf29fa4..c33dff2bae 100644 --- a/ext/date/tests/bug43960.phpt +++ b/ext/date/tests/bug43960.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #43960 (strtotime() returns timestamp in the future when given a bogus string) ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); var_dump(strtotime('i like to eat slices at work')); ?> --EXPECT-- diff --git a/ext/date/tests/bug45529.phpt b/ext/date/tests/bug45529.phpt index 0992c62f1c..b5d1d6a8ef 100644 --- a/ext/date/tests/bug45529.phpt +++ b/ext/date/tests/bug45529.phpt @@ -1,9 +1,8 @@ --TEST-- Bug #45529 (UTC not properly recognised as timezone identifier while parsing) ---INI-- -date.timezone=Europe/Oslo --FILE-- <?php +date_default_timezone_set('Europe/Oslo'); $tz1 = new DateTimeZone('UTC'); $tz2 = date_create('UTC')->getTimeZone(); echo $tz1->getName(), PHP_EOL; diff --git a/ext/date/tests/date-set-timestamp.phpt b/ext/date/tests/date-set-timestamp.phpt index 7a2b8f7acd..c799b368b8 100644 --- a/ext/date/tests/date-set-timestamp.phpt +++ b/ext/date/tests/date-set-timestamp.phpt @@ -1,9 +1,8 @@ --TEST-- DateTime::setTimestamp() ---INI-- -date.timezone=Europe/Oslo --FILE-- <?php +date_default_timezone_set('Europe/Oslo'); $d = new DateTime( '@1217184864' ); echo $d->format( "Y-m-d H:i e\n" ); diff --git a/ext/date/tests/date_add_basic.phpt b/ext/date/tests/date_add_basic.phpt index 675d2cf2f3..14a3d832bb 100644 --- a/ext/date/tests/date_add_basic.phpt +++ b/ext/date/tests/date_add_basic.phpt @@ -4,10 +4,9 @@ Test date_add() function : basic functionality Felix De Vliegher <felix.devliegher@gmail.com> --SKIPIF-- <?php if (!function_exists('date_add')) echo "skip: date_add() function not found!"; ?> ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); /* Prototype : void date_add(DateTime object, DateInterval interval) * Description: Adds an interval to the current date in object. * Source code: ext/date/php_date.c diff --git a/ext/date/tests/date_default_timezone_get-2.phpt b/ext/date/tests/date_default_timezone_get-2.phpt index 73013a7626..5859eeb404 100644 --- a/ext/date/tests/date_default_timezone_get-2.phpt +++ b/ext/date/tests/date_default_timezone_get-2.phpt @@ -1,7 +1,5 @@ --TEST-- date_default_timezone_get() function [2] ---INI-- -date.timezone=CEST --FILE-- <?php putenv('TZ='); diff --git a/ext/date/tests/date_default_timezone_get-3.phpt b/ext/date/tests/date_default_timezone_get-3.phpt index 0e2e3c53e5..fe11dfdc70 100644 --- a/ext/date/tests/date_default_timezone_get-3.phpt +++ b/ext/date/tests/date_default_timezone_get-3.phpt @@ -1,7 +1,5 @@ --TEST-- date_default_timezone_get() function [3] ---INI-- -date.timezone= --FILE-- <?php putenv('TZ=Europe/Rome'); diff --git a/ext/date/tests/date_default_timezone_set-1.phpt b/ext/date/tests/date_default_timezone_set-1.phpt index 3c7a9aa4d6..5af34d643f 100644 --- a/ext/date/tests/date_default_timezone_set-1.phpt +++ b/ext/date/tests/date_default_timezone_set-1.phpt @@ -1,7 +1,5 @@ --TEST-- date_default_timezone_set() function [1] ---INI-- -date.timezone= --FILE-- <?php putenv("TZ="); diff --git a/ext/date/tests/date_parse_001.phpt b/ext/date/tests/date_parse_001.phpt index d9b40b49b3..20586f6193 100644 --- a/ext/date/tests/date_parse_001.phpt +++ b/ext/date/tests/date_parse_001.phpt @@ -1,9 +1,8 @@ --TEST-- Test basic date_parse() ---INI-- -date.timezone=UTC --FILE-- <?php + date_default_timezone_set('UTC'); var_dump(date_parse("2006-12-12 10:00:00.5")); var_dump(date_parse("2006-12-12")); var_dump(date_parse("2006-12--12")); @@ -300,6 +299,6 @@ array(12) { bool(false) } -Warning: date_parse() expects parameter 1 to be string, array given in %sdate_parse_001.php on line 11 +Warning: date_parse() expects parameter 1 to be string, array given in %sdate_parse_001.php on line %d bool(false) Done diff --git a/ext/date/tests/date_period.phpt b/ext/date/tests/date_period.phpt index 65dd1b1274..6ec44351ae 100644 --- a/ext/date/tests/date_period.phpt +++ b/ext/date/tests/date_period.phpt @@ -1,9 +1,8 @@ --TEST-- DatePeriod ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $db = new DateTime( '2008-01-01' ); $de = new DateTime( '2008-12-31' ); $di = DateInterval::createFromDateString( 'first day of next month' ); diff --git a/ext/date/tests/date_sub_basic.phpt b/ext/date/tests/date_sub_basic.phpt index 8ebf02a712..0e12704945 100644 --- a/ext/date/tests/date_sub_basic.phpt +++ b/ext/date/tests/date_sub_basic.phpt @@ -4,10 +4,9 @@ Test date_sub() function : basic functionality Felix De Vliegher <felix.devliegher@gmail.com> --SKIPIF-- <?php if (!function_exists('date_sub')) echo "skip: date_sub() function not found!"; ?> ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); /* Prototype : void date_sub(DateTime object, DateInterval interval) * Description: Subtracts an interval from the current date in object. * Source code: ext/date/php_date.c diff --git a/ext/date/tests/date_sun_info_001.phpt b/ext/date/tests/date_sun_info_001.phpt index d469e37e7e..e4f893baaf 100644 --- a/ext/date/tests/date_sun_info_001.phpt +++ b/ext/date/tests/date_sun_info_001.phpt @@ -1,9 +1,8 @@ --TEST-- Test basic date_sun_info() ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); $sun_info = date_sun_info(strtotime("2006-12-12"), 31.7667, 35.2333); var_dump($sun_info); echo "Done\n"; diff --git a/ext/date/tests/date_sun_info_002.phpt b/ext/date/tests/date_sun_info_002.phpt index b41d123d97..6233392da4 100644 --- a/ext/date/tests/date_sun_info_002.phpt +++ b/ext/date/tests/date_sun_info_002.phpt @@ -1,9 +1,8 @@ --TEST-- Test basic date_sun_info() ---INI-- -date.timezone=Europe/Oslo --FILE-- <?php +date_default_timezone_set('Europe/Oslo'); $sun_info = date_sun_info(strtotime("2007-04-13 08:31:15 UTC"), 59.21, 9.61); foreach ($sun_info as $key => $elem ) { diff --git a/ext/date/tests/default-timezone-1.phpt b/ext/date/tests/default-timezone-1.phpt index ea5f2e6b84..a53d370afb 100644 --- a/ext/date/tests/default-timezone-1.phpt +++ b/ext/date/tests/default-timezone-1.phpt @@ -1,9 +1,8 @@ --TEST-- date.timezone setting [1] ---INI-- -date.timezone=GMT --FILE-- <?php +date_default_timezone_set('GMT'); putenv('TZ='); // clean TZ so that it doesn't bypass the ini option echo strtotime("2005-06-18 22:15:44"); ?> diff --git a/ext/date/tests/default-timezone-2.phpt b/ext/date/tests/default-timezone-2.phpt index c9a404bccb..b414eb2af3 100644 --- a/ext/date/tests/default-timezone-2.phpt +++ b/ext/date/tests/default-timezone-2.phpt @@ -1,9 +1,8 @@ --TEST-- date.timezone setting [2] ---INI-- -date.timezone=Europe/Oslo --FILE-- <?php +date_default_timezone_set('Europe/Oslo'); putenv('TZ='); // clean TZ so that it doesn't bypass the ini option echo strtotime("2005-06-18 22:15:44"); ?> diff --git a/ext/date/tests/oo_001.phpt b/ext/date/tests/oo_001.phpt index 9b6142158f..7cbf847c52 100644 --- a/ext/date/tests/oo_001.phpt +++ b/ext/date/tests/oo_001.phpt @@ -1,9 +1,8 @@ --TEST-- date OO interface ---INI-- -date.timezone=UTC --FILE-- <?php +date_default_timezone_set('UTC'); class _d extends DateTime { function __construct() { } diff --git a/ext/date/tests/oo_002.phpt b/ext/date/tests/oo_002.phpt index 0cd9187b1e..0dade99e72 100644 --- a/ext/date/tests/oo_002.phpt +++ b/ext/date/tests/oo_002.phpt @@ -1,9 +1,8 @@ --TEST-- date OO cloning ---INI-- -date.timezone=Europe/Berlin --FILE-- <?php +date_default_timezone_set('Europe/Berlin'); class _d extends DateTime {} class _t extends DateTimeZone {} $d = new _d("1pm Aug 1 GMT 2007"); diff --git a/ext/date/tests/strtotime_basic.phpt b/ext/date/tests/strtotime_basic.phpt index 48c8d6533a..75f66978ab 100644 --- a/ext/date/tests/strtotime_basic.phpt +++ b/ext/date/tests/strtotime_basic.phpt @@ -1,11 +1,10 @@ --TEST-- strtotime() function - a test to show the difference in behaviour between 'first' and '1', "second" and "2"... ---INI-- -date.timezone="UTC" --SKIPIF-- <?php if (!function_exists('strtotime')) echo "SKIP"; ?> --FILE-- <?php +date_default_timezone_set('UTC'); /* * The first of December 2008 is a Monday. * The term "Monday December 2008" will be parsed as the first Monday in December 2008. diff --git a/ext/date/tests/strtotime_variation_scottish.phpt b/ext/date/tests/strtotime_variation_scottish.phpt index 57ef734993..0b21b22741 100644 --- a/ext/date/tests/strtotime_variation_scottish.phpt +++ b/ext/date/tests/strtotime_variation_scottish.phpt @@ -1,9 +1,8 @@ --TEST-- Checking whisky time ---INI-- -date.timezone="UTC" --FILE-- <?php + date_default_timezone_set('UTC'); var_dump(date('H:i:s', strtotime('back of 7'))); var_dump(date('H:i:s', strtotime('front of 7'))); var_dump(date('H:i:s', strtotime('back of 19'))); diff --git a/ext/date/tests/test-parse-from-format.phpt b/ext/date/tests/test-parse-from-format.phpt index 991a3b1a4c..2bf9c4e1b8 100644 --- a/ext/date/tests/test-parse-from-format.phpt +++ b/ext/date/tests/test-parse-from-format.phpt @@ -1,9 +1,8 @@ --TEST-- date_create_from_format() and date_parse_from_format(). ---INI-- -date.timezone=Europe/Oslo --FILE-- <?php +date_default_timezone_set('Europe/Oslo'); $formats = array( DATE_ATOM, DATE_COOKIE, DATE_ISO8601, DATE_RFC822, DATE_RFC850, DATE_RFC1036, DATE_RFC1123, DATE_RFC2822, DATE_RFC3339, DATE_RSS, DATE_W3C ); diff --git a/ext/date/tests/timezone-configuration.phpt b/ext/date/tests/timezone-configuration.phpt index 147b10a823..7fbcda7f88 100644 --- a/ext/date/tests/timezone-configuration.phpt +++ b/ext/date/tests/timezone-configuration.phpt @@ -1,7 +1,5 @@ --TEST-- timezone configuration [1] ---INI-- -date.timezone=GMT --FILE-- <?php putenv('TZ=Europe/Oslo'); |