@@ -9,12 +9,29 @@ echo throws(function() {
9
9
unserialize ('C:24:"MongoDB\BSON\UTCDateTime":42:{a:1:{s:12:"milliseconds";s:9:"1234.5678";}} ' );
10
10
}, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
11
11
12
- /* TODO: Add tests for out-of-range values once CDRIVER-1377 is resolved */
12
+ // Out-of-range values
13
+ echo throws (function () {
14
+ unserialize ('C:24:"MongoDB\BSON\UTCDateTime":53:{a:1:{s:12:"milliseconds";s:19:"9223372036854775808";}} ' );
15
+ }, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
16
+
17
+ echo throws (function () {
18
+ unserialize ('C:24:"MongoDB\BSON\UTCDateTime":54:{a:1:{s:12:"milliseconds";s:20:"-9223372036854775809";}} ' );
19
+ }, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
20
+
21
+ echo throws (function () {
22
+ unserialize ('C:24:"MongoDB\BSON\UTCDateTime":54:{a:1:{s:12:"milliseconds";s:20:"18446744073709551615";}} ' );
23
+ }, 'MongoDB\Driver\Exception\InvalidArgumentException ' ), "\n" ;
13
24
14
25
?>
15
26
===DONE===
16
27
<?php exit (0 ); ?>
17
28
--EXPECT--
18
29
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
19
30
Error parsing "1234.5678" as 64-bit integer for MongoDB\BSON\UTCDateTime initialization
31
+ OK: Got MongoDB\Driver\Exception\InvalidArgumentException
32
+ Error parsing "9223372036854775808" as 64-bit integer for MongoDB\BSON\UTCDateTime initialization
33
+ OK: Got MongoDB\Driver\Exception\InvalidArgumentException
34
+ Error parsing "-9223372036854775809" as 64-bit integer for MongoDB\BSON\UTCDateTime initialization
35
+ OK: Got MongoDB\Driver\Exception\InvalidArgumentException
36
+ Error parsing "18446744073709551615" as 64-bit integer for MongoDB\BSON\UTCDateTime initialization
20
37
===DONE===
0 commit comments