File tree Expand file tree Collapse file tree 2 files changed +89
-0
lines changed Expand file tree Collapse file tree 2 files changed +89
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ PHPC-898: readConcern option should not be included in getMore commands (URI option)
3
+ --SKIPIF--
4
+ <?php require __DIR__ . "/../utils/basic-skipif.inc " ; NEEDS ("REPLICASET " ); ?>
5
+ <?php CLEANUP (REPLICASET ); ?>
6
+ --FILE--
7
+ <?php
8
+ require_once __DIR__ . "/../utils/basic.inc " ;
9
+
10
+ $ manager = new MongoDB \Driver \Manager (REPLICASET , ['readConcernLevel ' => 'local ' ]);
11
+
12
+ $ bulk = new MongoDB \Driver \BulkWrite ();
13
+ $ bulk ->insert (['_id ' => 1 ]);
14
+ $ bulk ->insert (['_id ' => 2 ]);
15
+ $ bulk ->insert (['_id ' => 3 ]);
16
+
17
+ $ result = $ manager ->executeBulkWrite (NS , $ bulk );
18
+ printf ("Inserted %d document(s) \n" , $ result ->getInsertedCount ());
19
+
20
+ $ query = new MongoDB \Driver \Query ([], ['batchSize ' => 2 ]);
21
+ $ cursor = $ manager ->executeQuery (NS , $ query );
22
+
23
+ foreach ($ cursor as $ document ) {
24
+ var_dump ($ document );
25
+ }
26
+
27
+ ?>
28
+ ===DONE===
29
+ <?php exit (0 ); ?>
30
+ --EXPECTF--
31
+ Inserted 3 document(s)
32
+ object(stdClass)#%d (1) {
33
+ ["_id"]=>
34
+ int(1)
35
+ }
36
+ object(stdClass)#%d (1) {
37
+ ["_id"]=>
38
+ int(2)
39
+ }
40
+ object(stdClass)#%d (1) {
41
+ ["_id"]=>
42
+ int(3)
43
+ }
44
+ ===DONE===
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ PHPC-898: readConcern option should not be included in getMore commands (query option)
3
+ --SKIPIF--
4
+ <?php require __DIR__ . "/../utils/basic-skipif.inc " ; NEEDS ("REPLICASET " ); ?>
5
+ <?php CLEANUP (REPLICASET ); ?>
6
+ --FILE--
7
+ <?php
8
+ require_once __DIR__ . "/../utils/basic.inc " ;
9
+
10
+ $ manager = new MongoDB \Driver \Manager (REPLICASET );
11
+
12
+ $ bulk = new MongoDB \Driver \BulkWrite ();
13
+ $ bulk ->insert (['_id ' => 1 ]);
14
+ $ bulk ->insert (['_id ' => 2 ]);
15
+ $ bulk ->insert (['_id ' => 3 ]);
16
+
17
+ $ result = $ manager ->executeBulkWrite (NS , $ bulk );
18
+ printf ("Inserted %d document(s) \n" , $ result ->getInsertedCount ());
19
+
20
+ $ rc = new MongoDB \Driver \ReadConcern (MongoDB \Driver \ReadConcern::LOCAL );
21
+ $ query = new MongoDB \Driver \Query ([], ['batchSize ' => 2 , 'readConcern ' => $ rc ]);
22
+ $ cursor = $ manager ->executeQuery (NS , $ query );
23
+
24
+ foreach ($ cursor as $ document ) {
25
+ var_dump ($ document );
26
+ }
27
+
28
+ ?>
29
+ ===DONE===
30
+ <?php exit (0 ); ?>
31
+ --EXPECTF--
32
+ Inserted 3 document(s)
33
+ object(stdClass)#%d (1) {
34
+ ["_id"]=>
35
+ int(1)
36
+ }
37
+ object(stdClass)#%d (1) {
38
+ ["_id"]=>
39
+ int(2)
40
+ }
41
+ object(stdClass)#%d (1) {
42
+ ["_id"]=>
43
+ int(3)
44
+ }
45
+ ===DONE===
You can’t perform that action at this time.
0 commit comments