File tree 2 files changed +38
-3
lines changed
2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 1
1
--TEST--
2
- MongoDB\Driver\Session::startTransaction() with wrong argument for options array on PHP 7
2
+ MongoDB\Driver\Session::startTransaction() with wrong argument for options array on PHP 7.0
3
3
--SKIPIF--
4
4
<?php require __DIR__ . "/../utils/basic-skipif.inc " ; ?>
5
5
<?php skip_if_not_libmongoc_crypto () ?>
6
6
<?php skip_if_no_transactions (); ?>
7
7
<?php skip_if_php_version ('< ' , '7.0.0 ' ); ?>
8
+ <?php skip_if_php_version ('>= ' , '7.1.0 ' ); ?>
8
9
--FILE--
9
10
<?php
10
11
require_once __DIR__ . "/../utils/basic.inc " ;
@@ -28,7 +29,7 @@ foreach ($options as $txnOptions) {
28
29
<?php exit (0 ); ?>
29
30
--EXPECTF--
30
31
OK: Got TypeError
31
- Argument 1 passed to MongoDB\Driver\Session::startTransaction() must be of the type array or null , int%S given
32
+ Argument 1 passed to MongoDB\Driver\Session::startTransaction() must be of the type array, int%S given
32
33
OK: Got TypeError
33
- Argument 1 passed to MongoDB\Driver\Session::startTransaction() must be of the type array or null , object given
34
+ Argument 1 passed to MongoDB\Driver\Session::startTransaction() must be of the type array, object given
34
35
===DONE===
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ MongoDB\Driver\Session::startTransaction() with wrong argument for options array on PHP 7
3
+ --SKIPIF--
4
+ <?php require __DIR__ . "/../utils/basic-skipif.inc " ; ?>
5
+ <?php skip_if_not_libmongoc_crypto () ?>
6
+ <?php skip_if_no_transactions (); ?>
7
+ <?php skip_if_php_version ('< ' , '7.1.0 ' ); ?>
8
+ --FILE--
9
+ <?php
10
+ require_once __DIR__ . "/../utils/basic.inc " ;
11
+
12
+ $ manager = new MongoDB \Driver \Manager (URI );
13
+ $ session = $ manager ->startSession ();
14
+
15
+ $ options = [
16
+ 2 ,
17
+ new stdClass ,
18
+ ];
19
+
20
+ foreach ($ options as $ txnOptions ) {
21
+ echo throws (function () use ($ session , $ txnOptions ) {
22
+ $ session ->startTransaction ($ txnOptions );
23
+ }, TypeError::class), "\n" ;
24
+ }
25
+
26
+ ?>
27
+ ===DONE===
28
+ <?php exit (0 ); ?>
29
+ --EXPECTF--
30
+ OK: Got TypeError
31
+ Argument 1 passed to MongoDB\Driver\Session::startTransaction() must be of the type array or null, int%S given
32
+ OK: Got TypeError
33
+ Argument 1 passed to MongoDB\Driver\Session::startTransaction() must be of the type array or null, object given
34
+ ===DONE===
You can’t perform that action at this time.
0 commit comments