Skip to content

Commit 2662df5

Browse files
committed
Merge new tests into existing files where appropriate
- bulkwritecommand-ctor-ordered-002: add getWriteConcernErrors() assertion (verifies empty array when only write errors occur); removes the need for a separate bulkwritecommandexception-getwriteconcernerrors-001.phpt - session-getTransactionOptions-001: add combined-options case (all four transaction options together); removes the need for a separate session-startTransaction-002.phpt
1 parent f80e673 commit 2662df5

File tree

4 files changed

+28
-72
lines changed

4 files changed

+28
-72
lines changed

tests/bulkwritecommand/bulkwritecommand-ctor-ordered-002.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ try {
2323
printf("%s(%d): %s\n", get_class($e), $e->getCode(), $e->getMessage());
2424
var_dump($e->getPartialResult());
2525
var_dump($e->getWriteErrors());
26+
var_dump($e->getWriteConcernErrors());
2627
}
2728

2829
?>
@@ -64,4 +65,6 @@ array(1) {
6465
}
6566
}
6667
}
68+
array(0) {
69+
}
6770
===DONE===

tests/exception/bulkwritecommandexception-getwriteconcernerrors-001.phpt

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/session/session-getTransactionOptions-001.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ $options = [
1919
['readConcern' => new \MongoDB\Driver\ReadConcern('majority')],
2020
['readPreference' => new \MongoDB\Driver\ReadPreference('primaryPreferred')],
2121
['writeConcern' => new \MongoDB\Driver\WriteConcern('majority')],
22+
[
23+
'maxCommitTimeMS' => 5000,
24+
'readConcern' => new \MongoDB\Driver\ReadConcern(\MongoDB\Driver\ReadConcern::MAJORITY),
25+
'readPreference' => new \MongoDB\Driver\ReadPreference(\MongoDB\Driver\ReadPreference::PRIMARY),
26+
'writeConcern' => new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY),
27+
],
2228
];
2329

2430
foreach ($options as $test) {
@@ -82,4 +88,23 @@ array(2) {
8288
string(8) "majority"
8389
}
8490
}
91+
array(4) {
92+
["maxCommitTimeMS"]=>
93+
int(5000)
94+
["readConcern"]=>
95+
object(MongoDB\Driver\ReadConcern)#%d (1) {
96+
["level"]=>
97+
string(8) "majority"
98+
}
99+
["readPreference"]=>
100+
object(MongoDB\Driver\ReadPreference)#%d (1) {
101+
["mode"]=>
102+
string(7) "primary"
103+
}
104+
["writeConcern"]=>
105+
object(MongoDB\Driver\WriteConcern)#%d (1) {
106+
["w"]=>
107+
string(8) "majority"
108+
}
109+
}
85110
===DONE===

tests/session/session-startTransaction-002.phpt

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)