summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
authorArd Biesheuvel <abies@php.net>2004-03-31 01:00:55 +0000
committerArd Biesheuvel <abies@php.net>2004-03-31 01:00:55 +0000
commit81cfb1b31216989fda72b0f9dbf4928a3db648e9 (patch)
treeed0a670a6266f403aabb911bd7182a60a56df39c /ext/standard
parent8ecdc90763aa5da2ff70531b63fdd7add40cc3d6 (diff)
downloadphp-git-81cfb1b31216989fda72b0f9dbf4928a3db648e9.tar.gz
Make time tests more robust against differences in implementation
# FreeBSD mktime() returns -1 if is_dst==1 and no DST timezone is set
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/tests/time/003.phpt2
-rw-r--r--ext/standard/tests/time/bug27719.phpt6
-rw-r--r--ext/standard/tests/time/mktime.phpt30
3 files changed, 19 insertions, 19 deletions
diff --git a/ext/standard/tests/time/003.phpt b/ext/standard/tests/time/003.phpt
index 2da8121b6a..90855f08ef 100644
--- a/ext/standard/tests/time/003.phpt
+++ b/ext/standard/tests/time/003.phpt
@@ -15,7 +15,7 @@ Check for mktime with out-of-range parameters
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";
diff --git a/ext/standard/tests/time/bug27719.phpt b/ext/standard/tests/time/bug27719.phpt
index 75d628920d..2484356aaa 100644
--- a/ext/standard/tests/time/bug27719.phpt
+++ b/ext/standard/tests/time/bug27719.phpt
@@ -1,7 +1,7 @@
--TEST--
Bug #27719: mktime returns incorrect timestamp for dst days
--FILE--
-<?php
+<?php /* $Id$ */
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 @@ Bug #27719: mktime returns incorrect timestamp for dst days
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
diff --git a/ext/standard/tests/time/mktime.phpt b/ext/standard/tests/time/mktime.phpt
index 95d40b9b17..8914ea0787 100644
--- a/ext/standard/tests/time/mktime.phpt
+++ b/ext/standard/tests/time/mktime.phpt
@@ -1,10 +1,10 @@
--TEST--
mktime()
--FILE--
-<?php
+<?php /* $Id$ */
$timezones = array(
'GMT0',
- 'GST-1GDT'
+ 'Europe/London'
);
foreach($timezones as $timezone)
@@ -15,35 +15,35 @@ foreach($timezones as $timezone)
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)