File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 7
7
use MongoDB \Driver \Exception \ExecutionTimeoutException ;
8
8
use MongoDB \Driver \Exception \RuntimeException ;
9
9
use MongoDB \Driver \Exception \ServerException ;
10
- use MongoDB \Driver \Exception \WriteException ;
11
10
use MongoDB \Tests \UnifiedSpecTests \Constraint \Matches ;
12
11
use PHPUnit \Framework \Assert ;
13
12
use stdClass ;
@@ -157,14 +156,14 @@ public function assert(?Throwable $e = null): void
157
156
}
158
157
159
158
if (isset ($ this ->matchesResultDocument )) {
160
- assertThat ($ e , logicalOr (isInstanceOf (CommandException::class), isInstanceOf (WriteException ::class)));
159
+ assertThat ($ e , logicalOr (isInstanceOf (CommandException::class), isInstanceOf (BulkWriteException ::class)));
161
160
162
161
if ($ e instanceof CommandException) {
163
162
assertThat ($ e ->getResultDocument (), $ this ->matchesResultDocument , 'CommandException result document matches ' );
164
- } elseif ($ e instanceof WriteException ) {
163
+ } elseif ($ e instanceof BulkWriteException ) {
165
164
$ writeErrors = $ e ->getWriteResult ()->getErrorReplies ();
166
165
assertCount (1 , $ writeErrors );
167
- assertThat ($ writeErrors [0 ], $ this ->matchesResultDocument , 'WriteException result document matches ' );
166
+ assertThat ($ writeErrors [0 ], $ this ->matchesResultDocument , 'BulkWriteException result document matches ' );
168
167
}
169
168
}
170
169
You can’t perform that action at this time.
0 commit comments