Skip to content

Commit 877637c

Browse files
committed
Merged pull request #892
2 parents e69aada + f10d16f commit 877637c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

tests/session/transaction-integration-001.phpt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ $EVENTS_COL = COLLECTION_NAME . '_events';
1717
$manager = new MongoDB\Driver\Manager(URI);
1818

1919
/* Create collections as that can't be (automatically) done in a transaction */
20-
$cmd = new \MongoDB\Driver\Command([
21-
'create' => $EMPLOYEES_COL
22-
]);
23-
$manager->executeCommand(DATABASE_NAME, $cmd);
20+
$manager->executeCommand(
21+
DATABASE_NAME,
22+
new \MongoDB\Driver\Command([ 'create' => $EMPLOYEES_COL ]),
23+
[ 'writeConcern' => new \MongoDB\Driver\WriteConcern( \MongoDB\Driver\WriteConcern::MAJORITY ) ]
24+
);
2425

25-
$cmd = new \MongoDB\Driver\Command([
26-
'create' => $EVENTS_COL
27-
]);
28-
$manager->executeCommand(DATABASE_NAME, $cmd);
26+
$manager->executeCommand(
27+
DATABASE_NAME,
28+
new \MongoDB\Driver\Command([ 'create' => $EVENTS_COL ]),
29+
[ 'writeConcern' => new \MongoDB\Driver\WriteConcern( \MongoDB\Driver\WriteConcern::MAJORITY ) ]
30+
);
2931

3032

3133
/* Do the transaction */

tests/session/transaction-integration-002.phpt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ require_once __DIR__ . "/../utils/basic.inc";
1313
$manager = new MongoDB\Driver\Manager(URI);
1414

1515
/* Create collections as that can't be (automatically) done in a transaction */
16-
$cmd = new \MongoDB\Driver\Command([
17-
'create' => COLLECTION_NAME,
18-
]);
19-
$manager->executeCommand(DATABASE_NAME, $cmd);
16+
$manager->executeCommand(
17+
DATABASE_NAME,
18+
new \MongoDB\Driver\Command([ 'create' => COLLECTION_NAME ]),
19+
[ 'writeConcern' => new \MongoDB\Driver\WriteConcern( \MongoDB\Driver\WriteConcern::MAJORITY ) ]
20+
);
2021

2122
/* Insert Data */
2223
$bw = new \MongoDB\Driver\BulkWrite();

0 commit comments

Comments
 (0)