abies Tue Mar 30 20:00:56 2004 EDT Modified files: /php-src/ext/standard/tests/time 003.phpt bug27719.phpt mktime.phpt Log: Make time tests more robust against differences in implementation # FreeBSD mktime() returns -1 if is_dst==1 and no DST timezone is set http://cvs.php.net/diff.php/php-src/ext/standard/tests/time/003.phpt?r1=1.2&r2=1.3&ty=u Index: php-src/ext/standard/tests/time/003.phpt diff -u php-src/ext/standard/tests/time/003.phpt:1.2 php-src/ext/standard/tests/time/003.phpt:1.3 --- php-src/ext/standard/tests/time/003.phpt:1.2 Sun Feb 9 07:22:18 2003 +++ php-src/ext/standard/tests/time/003.phpt Tue Mar 30 20:00:55 2004 @@ -15,7 +15,7 @@ echo date("Y-m-d", mktime( 12, 0, 0, 2, 29, 2001)) ."\n"; echo date("Y-m-d", mktime( 12, 0, 0, 0, 0, 2000)) ."\n"; - putenv("TZ=GST-1GDT"); + putenv("TZ=Europe/London"); echo date("Y-m-d H:i:s", mktime(12,0,0,3,+90,2000,-1))."\n"; echo date("Y-m-d H:i:s", mktime(12,0,0,3,+90,2000,0))."\n"; echo date("Y-m-d H:i:s", mktime(12,0,0,3,+90,2000,1))."\n"; http://cvs.php.net/diff.php/php-src/ext/standard/tests/time/bug27719.phpt?r1=1.3&r2=1.4&ty=u Index: php-src/ext/standard/tests/time/bug27719.phpt diff -u php-src/ext/standard/tests/time/bug27719.phpt:1.3 php-src/ext/standard/tests/time/bug27719.phpt:1.4 --- php-src/ext/standard/tests/time/bug27719.phpt:1.3 Mon Mar 29 16:57:29 2004 +++ php-src/ext/standard/tests/time/bug27719.phpt Tue Mar 30 20:00:55 2004 @@ -1,7 +1,7 @@ --TEST-- Bug #27719: mktime returns incorrect timestamp for dst days --FILE-- -<?php +<?php /* $Id: bug27719.phpt,v 1.4 2004/03/31 01:00:55 abies Exp $ */ putenv("TZ=EST"); // No DST $a = mktime(0, 0, 0, 4, 4, 2004, 0); $b = mktime(0, 0, 0, 4, 4, 2004, 1); @@ -43,9 +43,9 @@ echo "$c ".date("m/d/y h:i:s\n",$c); echo "\n"; ?> ---EXPECT-- -1081054800 04/04/04 12:00:00 +--EXPECTF-- 1081054800 04/04/04 12:00:00 +%s 1081054800 04/04/04 12:00:00 1075870800 02/04/04 12:00:00 http://cvs.php.net/diff.php/php-src/ext/standard/tests/time/mktime.phpt?r1=1.4&r2=1.5&ty=u Index: php-src/ext/standard/tests/time/mktime.phpt diff -u php-src/ext/standard/tests/time/mktime.phpt:1.4 php-src/ext/standard/tests/time/mktime.phpt:1.5 --- php-src/ext/standard/tests/time/mktime.phpt:1.4 Thu Oct 23 23:31:55 2003 +++ php-src/ext/standard/tests/time/mktime.phpt Tue Mar 30 20:00:55 2004 @@ -1,10 +1,10 @@ --TEST-- mktime() --FILE-- -<?php +<?php /* $Id: mktime.phpt,v 1.5 2004/03/31 01:00:55 abies Exp $ */ $timezones = array( 'GMT0', - 'GST-1GDT' + 'Europe/London' ); foreach($timezones as $timezone) @@ -15,35 +15,35 @@ var_dump(mktime(0, 0, 0, 1, 1, 2002)); /* status of daylight saving time unknown */ var_dump(mktime(0, 0, 0, 1, 1, 2002, -1)); - /* daylight saving time is not in affect */ + /* daylight saving time is not in effect */ var_dump(mktime(0, 0, 0, 1, 1, 2002, 0)); - /* daylight saving time is in affect */ + /* daylight saving time is in effect */ var_dump(mktime(0, 0, 0, 1, 1, 2002, 1)); /* status of daylight saving time unknown */ var_dump(mktime(0, 0, 0, 7, 1, 2002)); /* status of daylight saving time unknown */ var_dump(mktime(0, 0, 0, 7, 1, 2002, -1)); - /* daylight saving time is not in affect */ + /* daylight saving time is not in effect */ var_dump(mktime(0, 0, 0, 7, 1, 2002, 0)); - /* daylight saving time is in affect */ + /* daylight saving time is in effect */ var_dump(mktime(0, 0, 0, 7, 1, 2002, 1)); } ?> ---EXPECT-- +--EXPECTF-- int(1009843200) int(1009843200) int(1009843200) -int(1009843200) -int(1025481600) +int(%s) int(1025481600) int(1025481600) int(1025481600) +int(%s) +int(1009843200) +int(1009843200) +int(1009843200) int(1009839600) -int(1009839600) -int(1009839600) -int(1009836000) -int(1025474400) -int(1025474400) int(1025478000) -int(1025474400) +int(1025478000) +int(1025481600) +int(1025478000)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php