From: Derick Rethans Date: Wed, 7 Dec 2011 19:24:58 +0000 (+0000) Subject: Sorting out the tests *once* more. X-Git-Tag: php-5.3.9RC3~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60d195dc4473d1bae1884af5d4cd6a12674d70f8;p=php Sorting out the tests *once* more. Please keep them consistent and only change them if you are 110% certain what you're doing. Otherwise -> please ask. --- diff --git a/ext/date/tests/bug28088.phpt b/ext/date/tests/bug28088.phpt index 95866e00be..c310139383 100644 --- a/ext/date/tests/bug28088.phpt +++ b/ext/date/tests/bug28088.phpt @@ -1,9 +1,9 @@ --TEST-- Bug #28088 (strtotime() cannot convert 00 hours") +--INI-- +date.timezone=UTC --FILE-- +--INI-- +date.timezone=UTC +--FILE-- +format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$d->setTimestamp(100000000000); +var_dump($d->format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$i = new DateInterval('PT100000000000S'); +var_dump($i->format('%s')); +?> +--EXPECT-- +string(32) "5138-11-16 09:46:40 100000000000" +int(100000000000) +string(32) "5138-11-16 09:46:40 100000000000" +int(100000000000) +string(12) "100000000000" diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt index ae8fbc381d..c992a2847f 100644 --- a/ext/date/tests/bug52062.phpt +++ b/ext/date/tests/bug52062.phpt @@ -1,5 +1,11 @@ --TEST-- -Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (32 bit) +--SKIPIF-- + +--INI-- +date.timezone=UTC --FILE-- --FILE-- @@ -21,7 +21,8 @@ echo "*** Testing gmstrftime() : usage variation ***\n"; // Initialise function arguments not being substituted (if any) $timestamp = gmmktime(8, 8, 8, 8, 8, 2008); -setlocale(LC_ALL, "en_US.utf8", "en_US"); +setlocale(LC_TIME, "POSIX"); +putenv("LC_TIME=POSIX"); date_default_timezone_set("Asia/Calcutta"); //array of values to iterate over @@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) { --Preferred date and time representation-- string(2) "%c" -string(31) "Fri 08 Aug 2008 08:08:08 AM GMT" +string(24) "Fri Aug 8 08:08:08 2008" --Preferred date representation-- string(2) "%x" -string(10) "08/08/2008" +string(8) "08/08/08" --Preferred time representation-- string(2) "%X" -string(11) "08:08:08 AM" +string(8) "08:08:08" ===DONE=== diff --git a/ext/date/tests/strftime_variation22.phpt b/ext/date/tests/strftime_variation22.phpt index 151a7d2067..7b72ca51e1 100644 --- a/ext/date/tests/strftime_variation22.phpt +++ b/ext/date/tests/strftime_variation22.phpt @@ -5,8 +5,8 @@ Test strftime() function : usage variation - Checking Preferred date and time re if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { die("skip Test is not valid for Windows"); } -if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) { - die("skip Locale en_US.utf8 or en_US is needed by test and is not available"); +if(!setlocale(LC_ALL, "POSIX")) { + die("skip Locale POSIX is needed by test and is not available"); } ?> --FILE-- @@ -20,7 +20,8 @@ if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) { echo "*** Testing strftime() : usage variation ***\n"; // Initialise function arguments not being substituted (if any) -setlocale(LC_ALL, "en_US.utf8", "en_US"); +setlocale(LC_ALL, "POSIX"); +putenv("LC_ALL=POSIX"); date_default_timezone_set("Asia/Calcutta"); $timestamp = mktime(8, 8, 8, 8, 8, 2008); @@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) { --Preferred date and time representation-- string(2) "%c" -string(31) "Fri 08 Aug 2008 08:08:08 AM IST" +string(24) "Fri Aug 8 08:08:08 2008" --Preferred date representation-- string(2) "%x" -string(10) "08/08/2008" +string(8) "08/08/08" --Preferred time representation-- string(2) "%X" -string(11) "08:08:08 AM" +string(8) "08:08:08" ===DONE===