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";
1010$ classname = BSON_NAMESPACE . "\\Binary " ;
1111
1212$ binary = new $ classname ("random binary data " , $ classname ::TYPE_GENERIC );
13+ $ binary ->getData (2 );
14+ $ binary ->getType (2 );
1315
1416throws (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 " );
1718}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
1819
19- $ binary ->getData (2 );
20- $ binary ->getType (2 );
2120?>
2221===DONE===
2322<?php exit (0 ); ?>
2423--EXPECTF--
25- OK: Got MongoDB\Driver\Exception\InvalidArgumentException
26-
2724Warning: %s\Binary::getData() expects exactly 0 parameters, 1 given in %s on line %d
2825
2926Warning: %s\Binary::getType() expects exactly 0 parameters, 1 given in %s on line %d
27+ OK: Got MongoDB\Driver\Exception\InvalidArgumentException
3028===DONE===
3129
Original file line number Diff line number Diff line change @@ -7,18 +7,11 @@ BSON BSON\Javascript #001 error
77<?php
88require_once __DIR__ . "/../utils/basic.inc " ;
99
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 ;
2113}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
14+
2215?>
2316===DONE===
2417<?php exit (0 ); ?>
Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ BSON BSON\ObjectID #001 error
77<?php
88require_once __DIR__ . "/../utils/basic.inc " ;
99
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 );
1313}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
14+
1415?>
1516===DONE===
1617<?php exit (0 ); ?>
Original file line number Diff line number Diff line change @@ -8,22 +8,21 @@ BSON BSON\Regex #001 error
88require_once __DIR__ . "/../utils/basic.inc " ;
99
1010$ classname = BSON_NAMESPACE . "\\Regex " ;
11+
1112$ regexp = new $ classname ("regexp " , "i " );
13+ $ regexp ->getPattern (true );
14+ $ regexp ->getFlags (true );
1215
1316throws (function () use ($ classname ) {
14- $ regexp = new $ classname ;
17+ new $ classname ;
1518}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
1619
17- $ regexp ->getPattern (true );
18- $ regexp ->getFlags (true );
1920?>
2021===DONE===
2122<?php exit (0 ); ?>
2223--EXPECTF--
23- OK: Got MongoDB\Driver\Exception\InvalidArgumentException
24-
2524Warning: %s\Regex::getPattern() expects exactly 0 parameters, 1 given in %s on line %d
2625
2726Warning: %s\Regex::getFlags() expects exactly 0 parameters, 1 given in %s on line %d
27+ OK: Got MongoDB\Driver\Exception\InvalidArgumentException
2828===DONE===
29-
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ BSON BSON\Timestamp #001 error
77<?php
88require_once __DIR__ . "/../utils/basic.inc " ;
99
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 ;
1413}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
14+
1515?>
1616===DONE===
1717<?php exit (0 ); ?>
Original file line number Diff line number Diff line change @@ -4,18 +4,16 @@ BSON BSON\UTCDateTime #001 error
44date.timezone=America/Los_Angeles
55--SKIPIF--
66<?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 " ?>
88--FILE--
99<?php
1010require_once __DIR__ . "/../utils/basic.inc " ;
1111
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 ;
1815}, "MongoDB \\Driver \\Exception \\InvalidArgumentException " );
16+
1917?>
2018===DONE===
2119<?php exit (0 ); ?>
You can’t perform that action at this time.
0 commit comments