diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:28 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:35:28 -0400 |
| commit | ba50031707469046407a35b77a3cd81351e951b3 (patch) | |
| tree | 5c03e723bdbfabae09d41a3ab1253dff41eeed4a /ext/date/tests | |
| parent | 0a36161e13484a99ccf69bb38f206462d27cc6d6 (diff) | |
| download | php-upstream/5.1.5.tar.gz | |
Imported Upstream version 5.1.5upstream/5.1.5
Diffstat (limited to 'ext/date/tests')
| -rw-r--r-- | ext/date/tests/bug26317.phpt | 2 | ||||
| -rw-r--r-- | ext/date/tests/bug26320.phpt | 4 | ||||
| -rw-r--r-- | ext/date/tests/bug36224.phpt | 13 | ||||
| -rw-r--r-- | ext/date/tests/bug36510.phpt | 14 | ||||
| -rw-r--r-- | ext/date/tests/bug36599.phpt | 12 | ||||
| -rw-r--r-- | ext/date/tests/bug36988.phpt | 12 | ||||
| -rw-r--r-- | ext/date/tests/bug37017.phpt | 16 |
7 files changed, 70 insertions, 3 deletions
diff --git a/ext/date/tests/bug26317.phpt b/ext/date/tests/bug26317.phpt index c889666dc..aef29035e 100644 --- a/ext/date/tests/bug26317.phpt +++ b/ext/date/tests/bug26317.phpt @@ -1,6 +1,6 @@ --TEST-- Bug #26317 (military timezone offset signedness) ---SKIP-- +--SKIPIF-- if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { die("skip unable to change TZ enviroment variable\n"); } diff --git a/ext/date/tests/bug26320.phpt b/ext/date/tests/bug26320.phpt index b57712009..5b237cadb 100644 --- a/ext/date/tests/bug26320.phpt +++ b/ext/date/tests/bug26320.phpt @@ -1,6 +1,6 @@ --TEST-- Bug #26320 (strtotime handling of XML Schema/ISO 8601 format) ---SKIP-- +--SKIPIF-- if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { die("skip unable to change TZ enviroment variable\n"); } @@ -12,4 +12,4 @@ if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') { ?> --EXPECT-- 2003-11-19 12:30:42 -2003-11-19 12:30:42
\ No newline at end of file +2003-11-19 12:30:42 diff --git a/ext/date/tests/bug36224.phpt b/ext/date/tests/bug36224.phpt new file mode 100644 index 000000000..1690f4e7b --- /dev/null +++ b/ext/date/tests/bug36224.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #36224 (date(DATE_ATOM) gives wrong resulsts) +--FILE-- +<?php +date_default_timezone_set("Europe/Oslo"); + +echo date(DATE_ATOM, strtotime('2006-01-31T19:23:56Z')) . "\n"; +echo date(DATE_ATOM, strtotime('2006-01-31T19:23:56')) . "\n"; + +?> +--EXPECT-- +2006-01-31T20:23:56+01:00 +2006-01-31T19:23:56+01:00 diff --git a/ext/date/tests/bug36510.phpt b/ext/date/tests/bug36510.phpt new file mode 100644 index 000000000..ea8bb028b --- /dev/null +++ b/ext/date/tests/bug36510.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #36510 (strtotime() fails to parse date strings with tabs) +--FILE-- +<?php +date_default_timezone_set("UTC"); + +$t = 1140973388; + +var_dump(strtotime("-2 hours", $t)); +var_dump(strtotime("-2\thours", $t)); +?> +--EXPECT-- +int(1140966188) +int(1140966188) diff --git a/ext/date/tests/bug36599.phpt b/ext/date/tests/bug36599.phpt new file mode 100644 index 000000000..b34a7c288 --- /dev/null +++ b/ext/date/tests/bug36599.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #36599 (DATE_W3C format constant incorrect). +--FILE-- +<?php +date_default_timezone_set("UTC"); + +echo date( DATE_ATOM, strtotime( "2006-03-03 08:47:55" ) ), "\n"; +echo date( DATE_W3C, strtotime( "2006-03-03 08:47:55" ) ), "\n"; +?> +--EXPECT-- +2006-03-03T08:47:55+00:00 +2006-03-03T08:47:55+00:00 diff --git a/ext/date/tests/bug36988.phpt b/ext/date/tests/bug36988.phpt new file mode 100644 index 000000000..d35e58939 --- /dev/null +++ b/ext/date/tests/bug36988.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #36988 (mktime freezes on long numbers) +--INI-- +date.timezone=GMT +--FILE-- +<?php +$start = microtime(true); +$a = mktime(1, 1, 1, 1, 1, 11111111111); +echo (microtime(true) - $start) < 1 ? "smaller than one second" : "more than a second"; +?> +--EXPECT-- +smaller than one second diff --git a/ext/date/tests/bug37017.phpt b/ext/date/tests/bug37017.phpt new file mode 100644 index 000000000..61dc8ba38 --- /dev/null +++ b/ext/date/tests/bug37017.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #37017 (strtotime fails before 13:00:00 with some time zones identifiers). +--INI-- +date.timezone=GMT +--FILE-- +<?php +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"; +echo strtotime("2006-05-12 12:59:59 GMT"), "\n"; +?> +--EXPECT-- +1147453201 +1147453200 +1147453199 +1147438799 |
