7
7
use MongoDB \Collection ;
8
8
use MongoDB \Database ;
9
9
use MongoDB \Driver \BulkWrite ;
10
- use MongoDB \Driver \Exception \CommandException ;
11
10
use MongoDB \Driver \ReadConcern ;
12
11
use MongoDB \Driver \ReadPreference ;
13
12
use MongoDB \Driver \WriteConcern ;
@@ -457,6 +456,7 @@ function ($collection, $session, $options = []): void {
457
456
}, 'r ' ,
458
457
],
459
458
459
+ /* Disabled, as write aggregations are not supported in transactions
460
460
'read-write aggregate' => [
461
461
function ($collection, $session, $options = []): void {
462
462
$collection->aggregate(
@@ -468,6 +468,7 @@ function ($collection, $session, $options = []): void {
468
468
);
469
469
}, 'rw',
470
470
],
471
+ */
471
472
472
473
'bulkWrite insertOne ' => [
473
474
function ($ collection , $ session , $ options = []): void {
@@ -748,16 +749,7 @@ public function testMethodDoesNotInheritReadWriteConcernInTransaction(Closure $m
748
749
749
750
(new CommandObserver ())->observe (
750
751
function () use ($ method , $ collection , $ session ): void {
751
- try {
752
- call_user_func ($ method , $ collection , $ session );
753
- } catch (CommandException $ exception ) {
754
- // Write aggregates are not supported in transactions
755
- if ($ exception ->getResultDocument ()->codeName === 'OperationNotSupportedInTransaction ' ) {
756
- $ this ->markTestSkipped ('OperationNotSupportedInTransaction: ' . $ exception ->getMessage ());
757
- }
758
-
759
- throw $ exception ;
760
- }
752
+ call_user_func ($ method , $ collection , $ session );
761
753
},
762
754
function (array $ event ): void {
763
755
$ this ->assertObjectNotHasAttribute ('writeConcern ' , $ event ['started ' ]->getCommand ());
0 commit comments