File tree Expand file tree Collapse file tree 2 files changed +38
-20
lines changed Expand file tree Collapse file tree 2 files changed +38
-20
lines changed Original file line number Diff line number Diff line change 1
1
--TEST--
2
- Test for UTCDateTime and integer parsing
2
+ MongoDB\BSON\ UTCDateTime integer parsing from string
3
3
--SKIPIF--
4
4
<?php if (defined ("HHVM_VERSION_ID " )) exit ("skip HHVM implements only an older version of DateTime " ); ?>
5
5
--INI--
@@ -8,31 +8,15 @@ error_reporting=-1
8
8
dislay_errors=1
9
9
--FILE--
10
10
<?php
11
- echo "As number: \n" ;
12
- $ utcdatetime = new MongoDB \BSON \UTCDateTime (1416445411987 );
13
- var_dump ($ utcdatetime );
14
- var_dump ($ utcdatetime ->toDateTime ());
15
11
16
- echo "As string: \n" ;
17
12
$ utcdatetime = new MongoDB \BSON \UTCDateTime ('1416445411987 ' );
18
13
var_dump ($ utcdatetime );
19
14
var_dump ($ utcdatetime ->toDateTime ());
15
+
20
16
?>
17
+ ===DONE===
18
+ <?php exit (0 ); ?>
21
19
--EXPECTF--
22
- As number:
23
- object(MongoDB\BSON\UTCDateTime)#%d (1) {
24
- ["milliseconds"]=>
25
- %r(string\(13\) "|int\()%r1416445411987%r("|\))%r
26
- }
27
- object(DateTime)#%d (3) {
28
- ["date"]=>
29
- string(26) "2014-11-20 01:03:31.987000"
30
- ["timezone_type"]=>
31
- int(1)
32
- ["timezone"]=>
33
- string(6) "+00:00"
34
- }
35
- As string:
36
20
object(MongoDB\BSON\UTCDateTime)#%d (1) {
37
21
["milliseconds"]=>
38
22
%r(string\(13\) "|int\()%r1416445411987%r("|\))%r
@@ -45,3 +29,4 @@ object(DateTime)#%d (3) {
45
29
["timezone"]=>
46
30
string(6) "+00:00"
47
31
}
32
+ ===DONE===
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ MongoDB\BSON\UTCDateTime integer parsing from number (64-bit)
3
+ --SKIPIF--
4
+ <?php if (8 !== PHP_INT_SIZE ) { die ('skip Only for 64-bit platform ' ); } ?>
5
+ <?php if (defined ("HHVM_VERSION_ID " )) exit ("skip HHVM implements only an older version of DateTime " ); ?>
6
+ --INI--
7
+ date.timezone=UTC
8
+ error_reporting=-1
9
+ dislay_errors=1
10
+ --FILE--
11
+ <?php
12
+
13
+ $ utcdatetime = new MongoDB \BSON \UTCDateTime (1416445411987 );
14
+ var_dump ($ utcdatetime );
15
+ var_dump ($ utcdatetime ->toDateTime ());
16
+
17
+ ?>
18
+ ===DONE===
19
+ <?php exit (0 ); ?>
20
+ --EXPECTF--
21
+ object(MongoDB\BSON\UTCDateTime)#%d (1) {
22
+ ["milliseconds"]=>
23
+ %r(string\(13\) "|int\()%r1416445411987%r("|\))%r
24
+ }
25
+ object(DateTime)#%d (3) {
26
+ ["date"]=>
27
+ string(26) "2014-11-20 01:03:31.987000"
28
+ ["timezone_type"]=>
29
+ int(1)
30
+ ["timezone"]=>
31
+ string(6) "+00:00"
32
+ }
33
+ ===DONE===
You can’t perform that action at this time.
0 commit comments