From 6c242d9dd7a412862e0b60c53a89f201fad07d61 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 7 Dec 2011 19:24:58 +0000 Subject: [PATCH] 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. --- ext/date/tests/DateInterval_format.phpt | 7 ++--- ext/date/tests/DateInterval_format_a.phpt | 27 +++++++++++++++++++ ext/date/tests/bug52062-64bit.phpt | 27 +++++++++++++++++++ ext/date/tests/bug52062.phpt | 4 +-- ext/date/tests/bug53502.phpt | 2 ++ .../tests/date_default_timezone_set-1.phpt | 4 +++ 6 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 ext/date/tests/DateInterval_format_a.phpt create mode 100644 ext/date/tests/bug52062-64bit.phpt diff --git a/ext/date/tests/DateInterval_format.phpt b/ext/date/tests/DateInterval_format.phpt index b2fdef49c3..c144f585ac 100644 --- a/ext/date/tests/DateInterval_format.phpt +++ b/ext/date/tests/DateInterval_format.phpt @@ -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('h=%h') . "\n"; 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 @@ h=4 i=5 s=6 r= -a=428 inverted R=- inverted r=- diff --git a/ext/date/tests/DateInterval_format_a.phpt b/ext/date/tests/DateInterval_format_a.phpt new file mode 100644 index 0000000000..d095db56b3 --- /dev/null +++ b/ext/date/tests/DateInterval_format_a.phpt @@ -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 diff --git a/ext/date/tests/bug52062-64bit.phpt b/ext/date/tests/bug52062-64bit.phpt new file mode 100644 index 0000000000..861e578dd2 --- /dev/null +++ b/ext/date/tests/bug52062-64bit.phpt @@ -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" diff --git a/ext/date/tests/bug52062.phpt b/ext/date/tests/bug52062.phpt index 967a1b6f63..c992a2847f 100644 --- a/ext/date/tests/bug52062.phpt +++ b/ext/date/tests/bug52062.phpt @@ -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 diff --git a/ext/date/tests/bug53502.phpt b/ext/date/tests/bug53502.phpt index 6c17078090..87b648e354 100644 --- a/ext/date/tests/bug53502.phpt +++ b/ext/date/tests/bug53502.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #53502: strtotime with timezone memory leak +--INI-- +date.timezone=UTC --FILE-- --INI-- date.timezone= --FILE-- -- 2.40.0