Skip to content

Commit 28cc1f5

Browse files
committed
Remove rw aggregation not supported in a transaction
1 parent 52340de commit 28cc1f5

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

tests/Collection/CollectionFunctionalTest.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use MongoDB\Collection;
88
use MongoDB\Database;
99
use MongoDB\Driver\BulkWrite;
10-
use MongoDB\Driver\Exception\CommandException;
1110
use MongoDB\Driver\ReadConcern;
1211
use MongoDB\Driver\ReadPreference;
1312
use MongoDB\Driver\WriteConcern;
@@ -457,6 +456,7 @@ function ($collection, $session, $options = []): void {
457456
}, 'r',
458457
],
459458

459+
/* Disabled, as write aggregations are not supported in transactions
460460
'read-write aggregate' => [
461461
function ($collection, $session, $options = []): void {
462462
$collection->aggregate(
@@ -468,6 +468,7 @@ function ($collection, $session, $options = []): void {
468468
);
469469
}, 'rw',
470470
],
471+
*/
471472

472473
'bulkWrite insertOne' => [
473474
function ($collection, $session, $options = []): void {
@@ -748,16 +749,7 @@ public function testMethodDoesNotInheritReadWriteConcernInTransaction(Closure $m
748749

749750
(new CommandObserver())->observe(
750751
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);
761753
},
762754
function (array $event): void {
763755
$this->assertObjectNotHasAttribute('writeConcern', $event['started']->getCommand());

0 commit comments

Comments
 (0)