]> granicus.if.org Git - php/commitdiff
Sorting out the tests *once* more.
authorDerick Rethans <derick@php.net>
Wed, 7 Dec 2011 19:24:58 +0000 (19:24 +0000)
committerDerick Rethans <derick@php.net>
Wed, 7 Dec 2011 19:24:58 +0000 (19:24 +0000)
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
ext/date/tests/DateInterval_format_a.phpt [new file with mode: 0644]
ext/date/tests/bug52062-64bit.phpt [new file with mode: 0644]
ext/date/tests/bug52062.phpt
ext/date/tests/bug53502.phpt
ext/date/tests/date_default_timezone_set-1.phpt

index b2fdef49c3dd6b62ef77d261ef386293a12f83a9..c144f585ac4209161dc518ecabf26703ed621411 100644 (file)
@@ -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 <danielc@php.net>
 # 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 (file)
index 0000000..d095db5
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+DateInterval::format(), %a
+--CREDITS--
+Daniel Convissor <danielc@php.net>
+# TestFest 2010 BKTK
+--INI--
+date.timezone=UTC
+--SKIPIF--
+<?php 
+if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist"); 
+if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
+?>
+--XFAIL--
+Windows VC6 libs' floor()/ceil() choke on floats
+--FILE--
+<?php
+
+$date1 = new DateTime('2000-01-01 00:00:00');
+$date2 = new DateTime('2001-03-04 04:05:06');
+
+$interval = $date1->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 (file)
index 0000000..861e578
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (64 bit)
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE == 4) die('skip 64 bit only');
+?>
+--INI--
+date.timezone=UTC
+--FILE--
+<?php
+$d = new DateTime('@100000000000');
+var_dump($d->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"
index 967a1b6f6395c95735e66fb1ec326565c99efb58..c992a2847fecc1f4624e2c44979d1f2e8fadc7d2 100644 (file)
@@ -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--
 <?php
-if (PHP_INT_SIZE == 4) die('skip tests require 64bit integer (php\' int, long in C.');
+if (PHP_INT_SIZE == 8) die('skip 32-bit only');
 ?>
 --INI--
 date.timezone=UTC
index 6c17078090f6cfa47b1bbde938c0d8b0393dd9c3..87b648e354f91d27eccc38c1f24f66d63273355a 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #53502: strtotime with timezone memory leak
+--INI--
+date.timezone=UTC
 --FILE--
 <?php
 for ($i = 0; $i < 1000; $i++) {
index f5eea4f9596b4a9cc1568e4633d988492afafa72..7afa2b1a168a01a2777ba543fe633bb9fcc1ccf4 100644 (file)
@@ -1,5 +1,9 @@
 --TEST--
 date_default_timezone_set() function [1]
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') die('skip diff TZ detection on windows.');
+?>
 --INI--
 date.timezone=
 --FILE--