com php-src: Added a test case to make sure microseconds work.: ext/date/tests/bug73837.phpt
| From: | Derick Rethans | Date: | Fri, 24 Mar 2017 11:39:32 +0000 |
| Subject: | com php-src: Added a test case to make sure microseconds work.: ext/date/tests/bug73837.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97393@lists.php.net to get a copy of this message | ||
Commit: ee49d4b4be730af17881dada989d9e1d9110079b
Author: Derick Rethans <github@derickrethans.nl> Fri, 24 Mar 2017 11:39:32 +0000
Parents: e3e35476273881c6b60ee280f58a7ce2b41b6ab6
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ee49d4b4be730af17881dada989d9e1d9110079b
Log:
Added a test case to make sure microseconds work.
Changed paths:
A ext/date/tests/bug73837.phpt
Diff:
diff --git a/ext/date/tests/bug73837.phpt b/ext/date/tests/bug73837.phpt
new file mode 100644
index 0000000..220deb6
--- /dev/null
+++ b/ext/date/tests/bug73837.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #73837: Milliseconds in DateTime()
+--FILE--
+<?php
+$collect = [];
+
+for ( $i = 0; $i < 1000; $i++ )
+{
+ $a = new DateTime();
+ $key = "s" . $a->format( "u" );
+ $collect[$key] = true;
+}
+
+echo ( count( $collect ) > 990 ) ? "microseconds differ\n" : "microseconds do not
differ enough\n";
+?>
+--EXPECT--
+microseconds differ