Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug28088.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/bug28088.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug28088.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,9 +1,9 @@ --TEST-- Bug #28088 (strtotime() cannot convert 00 hours") +--INI-- +date.timezone=UTC --FILE-- diff($end); -$p = new DatePeriod($start, $diff, 2); -$diff_s = serialize($diff); -var_dump($diff, $diff_s); -var_export($diff); - -$diff_un = unserialize($diff_s); -$p = new DatePeriod($start, $diff_un, 2); -var_dump($diff_un, $p); - -$unser = DateInterval::__set_state(array( - 'y' => 7, - 'm' => 6, - 'd' => 5, - 'h' => 4, - 'i' => 3, - 's' => 2, - 'invert' => 1, - 'days' => 2400, -)); - -$p = new DatePeriod($start, $diff_un, 2); -var_dump($unser, $p); - -?> ---EXPECT-- -object(DateInterval)#3 (8) { - ["y"]=> - int(0) - ["m"]=> - int(0) - ["d"]=> - int(0) - ["h"]=> - int(4) - ["i"]=> - int(0) - ["s"]=> - int(0) - ["invert"]=> - int(0) - ["days"]=> - int(0) -} -string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}" -DateInterval::__set_state(array( - 'y' => 0, - 'm' => 0, - 'd' => 0, - 'h' => 4, - 'i' => 0, - 's' => 0, - 'invert' => 0, - 'days' => 0, -))object(DateInterval)#5 (8) { - ["y"]=> - int(0) - ["m"]=> - int(0) - ["d"]=> - int(0) - ["h"]=> - int(4) - ["i"]=> - int(0) - ["s"]=> - int(0) - ["invert"]=> - int(0) - ["days"]=> - int(0) -} -object(DatePeriod)#6 (0) { -} -object(DateInterval)#4 (8) { - ["y"]=> - int(7) - ["m"]=> - int(6) - ["d"]=> - int(5) - ["h"]=> - int(4) - ["i"]=> - int(3) - ["s"]=> - int(2) - ["invert"]=> - int(1) - ["days"]=> - int(2400) -} -object(DatePeriod)#7 (0) { -} Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -0,0 +1,27 @@ +--TEST-- +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (64 bit) +--SKIPIF-- + +--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" Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -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-- diff($end); +$p = new DatePeriod($start, $diff, 2); +$diff_s = serialize($diff); +var_dump($diff, $diff_s); +var_export($diff); + +$diff_un = unserialize($diff_s); +$p = new DatePeriod($start, $diff_un, 2); +var_dump($diff_un, $p); + +$unser = DateInterval::__set_state(array( + 'y' => 7, + 'm' => 6, + 'd' => 5, + 'h' => 4, + 'i' => 3, + 's' => 2, + 'invert' => 1, + 'days' => 2400, +)); + +$p = new DatePeriod($start, $diff_un, 2); +var_dump($unser, $p); + +?> +--EXPECT-- +object(DateInterval)#3 (8) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(0) + ["h"]=> + int(4) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) +} +string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}" +DateInterval::__set_state(array( + 'y' => 0, + 'm' => 0, + 'd' => 0, + 'h' => 4, + 'i' => 0, + 's' => 0, + 'invert' => 0, + 'days' => 0, +))object(DateInterval)#5 (8) { + ["y"]=> + int(0) + ["m"]=> + int(0) + ["d"]=> + int(0) + ["h"]=> + int(4) + ["i"]=> + int(0) + ["s"]=> + int(0) + ["invert"]=> + int(0) + ["days"]=> + int(0) +} +object(DatePeriod)#6 (0) { +} +object(DateInterval)#4 (8) { + ["y"]=> + int(7) + ["m"]=> + int(6) + ["d"]=> + int(5) + ["h"]=> + int(4) + ["i"]=> + int(3) + ["s"]=> + int(2) + ["invert"]=> + int(1) + ["days"]=> + int(2400) +} +object(DatePeriod)#7 (0) { +} Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug53502.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/bug53502.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug53502.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,5 +1,7 @@ --TEST-- Bug #53502: strtotime with timezone memory leak +--INI-- +date.timezone=UTC --FILE-- --FILE-- @@ -21,7 +21,8 @@ // 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 @@ --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=== Modified: php/php-src/branches/PHP_5_3/ext/date/tests/strftime_variation22.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/date/tests/strftime_variation22.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_3/ext/date/tests/strftime_variation22.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -5,8 +5,8 @@ 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 @@ 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 @@ --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=== Modified: php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,5 +1,8 @@ --TEST-- -DateInterval::format() +DateInterval::format(), except %a +--DESCRIPTION-- +%a is covered in a separate test. +Don't want an XFAIL here to cause confusion if a real bug comes up. --CREDITS-- Daniel Convissor # TestFest 2010 BKTK @@ -29,7 +32,6 @@ echo $interval->format('i=%i') . "\n"; echo $interval->format('s=%s') . "\n"; echo $interval->format('r=%r') . "\n"; -echo $interval->format('a=%a') . "\n"; echo "\n"; @@ -61,7 +63,6 @@ i=5 s=6 r= -a=428 inverted R=- inverted r=- Added: php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -0,0 +1,27 @@ +--TEST-- +DateInterval::format(), %a +--CREDITS-- +Daniel Convissor +# TestFest 2010 BKTK +--INI-- +date.timezone=UTC +--SKIPIF-- + +--XFAIL-- +Windows VC6 libs' floor()/ceil() choke on floats +--FILE-- +diff($date2); + +echo $interval->format('a=%a') . "\n"; + +?> +--EXPECT-- +a=428 Added: php/php-src/branches/PHP_5_4/ext/date/tests/bug52062-64bit.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/bug52062-64bit.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug52062-64bit.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -0,0 +1,27 @@ +--TEST-- +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (64 bit) +--SKIPIF-- + +--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" Modified: php/php-src/branches/PHP_5_4/ext/date/tests/bug52062.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/bug52062.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug52062.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,8 +1,8 @@ --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 Modified: php/php-src/branches/PHP_5_4/ext/date/tests/bug53502.phpt =================================================================== --- php/php-src/branches/PHP_5_4/ext/date/tests/bug53502.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug53502.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,5 +1,7 @@ --TEST-- Bug #53502: strtotime with timezone memory leak +--INI-- +date.timezone=UTC --FILE-- --INI-- date.timezone= --FILE-- Modified: php/php-src/trunk/ext/date/tests/DateInterval_format.phpt =================================================================== --- php/php-src/trunk/ext/date/tests/DateInterval_format.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/trunk/ext/date/tests/DateInterval_format.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,5 +1,8 @@ --TEST-- -DateInterval::format() +DateInterval::format(), except %a +--DESCRIPTION-- +%a is covered in a separate test. +Don't want an XFAIL here to cause confusion if a real bug comes up. --CREDITS-- Daniel Convissor # TestFest 2010 BKTK @@ -29,7 +32,6 @@ echo $interval->format('i=%i') . "\n"; echo $interval->format('s=%s') . "\n"; echo $interval->format('r=%r') . "\n"; -echo $interval->format('a=%a') . "\n"; echo "\n"; @@ -61,7 +63,6 @@ i=5 s=6 r= -a=428 inverted R=- inverted r=- Added: php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt =================================================================== --- php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt (rev 0) +++ php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -0,0 +1,27 @@ +--TEST-- +DateInterval::format(), %a +--CREDITS-- +Daniel Convissor +# TestFest 2010 BKTK +--INI-- +date.timezone=UTC +--SKIPIF-- + +--XFAIL-- +Windows VC6 libs' floor()/ceil() choke on floats +--FILE-- +diff($date2); + +echo $interval->format('a=%a') . "\n"; + +?> +--EXPECT-- +a=428 Added: php/php-src/trunk/ext/date/tests/bug52062-64bit.phpt =================================================================== --- php/php-src/trunk/ext/date/tests/bug52062-64bit.phpt (rev 0) +++ php/php-src/trunk/ext/date/tests/bug52062-64bit.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -0,0 +1,27 @@ +--TEST-- +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (64 bit) +--SKIPIF-- + +--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" Modified: php/php-src/trunk/ext/date/tests/bug52062.phpt =================================================================== --- php/php-src/trunk/ext/date/tests/bug52062.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/trunk/ext/date/tests/bug52062.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,8 +1,8 @@ --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 Modified: php/php-src/trunk/ext/date/tests/bug53502.phpt =================================================================== --- php/php-src/trunk/ext/date/tests/bug53502.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/trunk/ext/date/tests/bug53502.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,5 +1,7 @@ --TEST-- Bug #53502: strtotime with timezone memory leak +--INI-- +date.timezone=UTC --FILE--