File tree Expand file tree Collapse file tree 6 files changed +26
-37
lines changed Expand file tree Collapse file tree 6 files changed +26
-37
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,20 @@ require_once __DIR__ . "/../utils/basic.inc";
10
10
$ classname = BSON_NAMESPACE . "\\Binary " ;
11
11
12
12
$ binary = new $ classname ("random binary data " , $ classname ::TYPE_GENERIC );
13
+ $ binary ->getData (2 );
14
+ $ binary ->getType (2 );
13
15
14
16
throws (function () use ($ classname ) {
15
- $ b = new $ classname ("random binary data without type " );
16
- echo "FAIL: Constructed BSON\Binary without type! \n" ;
17
+ new $ classname ("random binary data without type " );
17
18
}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
18
19
19
- $ binary ->getData (2 );
20
- $ binary ->getType (2 );
21
20
?>
22
21
===DONE===
23
22
<?php exit (0 ); ?>
24
23
--EXPECTF--
25
- OK: Got MongoDB\Driver\Exception\InvalidArgumentException
26
-
27
24
Warning: %s\Binary::getData() expects exactly 0 parameters, 1 given in %s on line %d
28
25
29
26
Warning: %s\Binary::getType() expects exactly 0 parameters, 1 given in %s on line %d
27
+ OK: Got MongoDB\Driver\Exception\InvalidArgumentException
30
28
===DONE===
31
29
Original file line number Diff line number Diff line change @@ -7,18 +7,11 @@ BSON BSON\Javascript #001 error
7
7
<?php
8
8
require_once __DIR__ . "/../utils/basic.inc " ;
9
9
10
- $ classname = BSON_NAMESPACE . "\\Javascript " ;
11
-
12
- $ js = new $ classname ("function foo(bar) {var baz = bar; var bar = foo; return bar; } " );
13
- $ jswscope = new $ classname ("function foo(bar) {var baz = bar; var bar = foo; return bar; } " , array ("foo " => 42 ));
14
- $ tests = array (
15
- array ("js " => $ js ),
16
- array ("jswscope " => $ jswscope ),
17
- );
18
-
19
- throws (function () use ($ classname ) {
20
- $ j = new $ classname ;
10
+ throws (function () {
11
+ $ classname = BSON_NAMESPACE . "\\Javascript " ;
12
+ new $ classname ;
21
13
}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
14
+
22
15
?>
23
16
===DONE===
24
17
<?php exit (0 ); ?>
Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ BSON BSON\ObjectID #001 error
7
7
<?php
8
8
require_once __DIR__ . "/../utils/basic.inc " ;
9
9
10
- $ classname = BSON_NAMESPACE . "\\ ObjectID " ;
11
- throws ( function () use ( $ classname) {
12
- $ id = new $ classname (new stdclass );
10
+ throws ( function () {
11
+ $ classname = BSON_NAMESPACE . "\\ ObjectID " ;
12
+ new $ classname (new stdclass );
13
13
}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
14
+
14
15
?>
15
16
===DONE===
16
17
<?php exit (0 ); ?>
Original file line number Diff line number Diff line change @@ -8,22 +8,21 @@ BSON BSON\Regex #001 error
8
8
require_once __DIR__ . "/../utils/basic.inc " ;
9
9
10
10
$ classname = BSON_NAMESPACE . "\\Regex " ;
11
+
11
12
$ regexp = new $ classname ("regexp " , "i " );
13
+ $ regexp ->getPattern (true );
14
+ $ regexp ->getFlags (true );
12
15
13
16
throws (function () use ($ classname ) {
14
- $ regexp = new $ classname ;
17
+ new $ classname ;
15
18
}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
16
19
17
- $ regexp ->getPattern (true );
18
- $ regexp ->getFlags (true );
19
20
?>
20
21
===DONE===
21
22
<?php exit (0 ); ?>
22
23
--EXPECTF--
23
- OK: Got MongoDB\Driver\Exception\InvalidArgumentException
24
-
25
24
Warning: %s\Regex::getPattern() expects exactly 0 parameters, 1 given in %s on line %d
26
25
27
26
Warning: %s\Regex::getFlags() expects exactly 0 parameters, 1 given in %s on line %d
27
+ OK: Got MongoDB\Driver\Exception\InvalidArgumentException
28
28
===DONE===
29
-
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ BSON BSON\Timestamp #001 error
7
7
<?php
8
8
require_once __DIR__ . "/../utils/basic.inc " ;
9
9
10
- $ classname = BSON_NAMESPACE . "\\Timestamp " ;
11
-
12
- throws (function () use ($ classname ) {
13
- $ s = new $ classname ;
10
+ throws (function () {
11
+ $ classname = BSON_NAMESPACE . "\\Timestamp " ;
12
+ new $ classname ;
14
13
}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
14
+
15
15
?>
16
16
===DONE===
17
17
<?php exit (0 ); ?>
Original file line number Diff line number Diff line change @@ -4,18 +4,16 @@ BSON BSON\UTCDateTime #001 error
4
4
date.timezone=America/Los_Angeles
5
5
--SKIPIF--
6
6
<?php if (defined ("HHVM_VERSION_ID " )) exit ("skip HHVM handles parameter parsing differently " ); ?>
7
- <?php require __DIR__ . "/../utils/basic-skipif.inc " ; CLEANUP ( STANDALONE ) ?>
7
+ <?php require __DIR__ . "/../utils/basic-skipif.inc " ?>
8
8
--FILE--
9
9
<?php
10
10
require_once __DIR__ . "/../utils/basic.inc " ;
11
11
12
- $ manager = new MongoDB \Driver \Manager (STANDALONE );
13
-
14
- $ classname = BSON_NAMESPACE . "\\UTCDateTime " ;
15
-
16
- throws (function () use ($ classname ) {
17
- $ d = new $ classname ;
12
+ throws (function () {
13
+ $ classname = BSON_NAMESPACE . "\\UTCDateTime " ;
14
+ new $ classname ;
18
15
}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
16
+
19
17
?>
20
18
===DONE===
21
19
<?php exit (0 ); ?>
You can’t perform that action at this time.
0 commit comments