Skip to content

Commit 33e91fa

Browse files
committed
Use throws() helper function in WriteConcern ctor error test
1 parent e30b93b commit 33e91fa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/writeConcern/writeconcern-ctor_error-001.phpt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ MongoDB\Driver\WriteConcern construction (invalid arguments)
77
<?php
88
require_once __DIR__ . "/../utils/basic.inc";
99

10-
try {
10+
echo throws(function() {
1111
new MongoDB\Driver\WriteConcern("string", 10000, false, true, 1);
12-
} catch(InvalidArgumentException $e) {
13-
echo $e->getMessage(), "\n";
14-
}
12+
}, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n";
1513

1614
?>
1715
===DONE===
1816
<?php exit(0); ?>
1917
--EXPECTF--
18+
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
2019
MongoDB\Driver\WriteConcern::__construct() expects at most 4 parameters, 5 given
2120
===DONE===

0 commit comments

Comments
 (0)