File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ WriteConcernError: Populate WriteConcernError on WriteConcern errors
3
+ --SKIPIF--
4
+ <?php require "tests/utils/basic-skipif.inc " ?>
5
+ --FILE--
6
+ <?php
7
+ require_once "tests/utils/basic.inc " ;
8
+
9
+ $ mc = new MongoDB \Driver \Manager (MONGODB_REPLICASET_URI );
10
+
11
+ $ batch = new MongoDB \Driver \WriteBatch ;
12
+
13
+ $ batch ->insert (array ("my " => "value " ));
14
+
15
+ $ w = new MongoDB \Driver \WriteConcern (30 , 100 );
16
+ $ retval = $ mc ->executeWriteBatch (NS , $ batch , $ w );
17
+
18
+ printWriteResult ($ retval );
19
+ ?>
20
+ ===DONE===
21
+ <?php exit (0 ); ?>
22
+ --EXPECTF--
23
+ server: %s:%d
24
+ insertedCount: 1
25
+ matchedCount: 0
26
+ modifiedCount: 0
27
+ upsertedCount: 0
28
+ deletedCount: 0
29
+ writeConcernError.message: waiting for replication timed out
30
+ writeConcernError.code: 64
31
+ writeConcernError.info: array(1) {
32
+ ["wtimeout"]=>
33
+ bool(true)
34
+ }
35
+ ===DONE===
You can’t perform that action at this time.
0 commit comments