File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 77use MongoDB \Driver \Exception \ExecutionTimeoutException ;
88use MongoDB \Driver \Exception \RuntimeException ;
99use MongoDB \Driver \Exception \ServerException ;
10- use MongoDB \Driver \Exception \WriteException ;
1110use MongoDB \Tests \UnifiedSpecTests \Constraint \Matches ;
1211use PHPUnit \Framework \Assert ;
1312use stdClass ;
@@ -157,14 +156,14 @@ public function assert(?Throwable $e = null): void
157156 }
158157
159158 if (isset ($ this ->matchesResultDocument )) {
160- assertThat ($ e , logicalOr (isInstanceOf (CommandException::class), isInstanceOf (WriteException ::class)));
159+ assertThat ($ e , logicalOr (isInstanceOf (CommandException::class), isInstanceOf (BulkWriteException ::class)));
161160
162161 if ($ e instanceof CommandException) {
163162 assertThat ($ e ->getResultDocument (), $ this ->matchesResultDocument , 'CommandException result document matches ' );
164- } elseif ($ e instanceof WriteException ) {
163+ } elseif ($ e instanceof BulkWriteException ) {
165164 $ writeErrors = $ e ->getWriteResult ()->getErrorReplies ();
166165 assertCount (1 , $ writeErrors );
167- assertThat ($ writeErrors [0 ], $ this ->matchesResultDocument , 'WriteException result document matches ' );
166+ assertThat ($ writeErrors [0 ], $ this ->matchesResultDocument , 'BulkWriteException result document matches ' );
168167 }
169168 }
170169
You can’t perform that action at this time.
0 commit comments