File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 13
13
use MongoDB \Operation \FindOneAndReplace ;
14
14
use MongoDB \Operation \FindOneAndUpdate ;
15
15
use PHPUnit \Framework \Assert ;
16
- use PHPUnit \Framework \Exception as PHPUnitException ;
16
+ use PHPUnit \Framework \AssertionFailedError ;
17
17
use stdClass ;
18
18
use Throwable ;
19
19
use Traversable ;
@@ -129,11 +129,15 @@ public function assert(bool $rethrowExceptions = false)
129
129
$ result = $ this ->execute ();
130
130
$ saveResultAsEntity = $ this ->saveResultAsEntity ;
131
131
} catch (Throwable $ e ) {
132
- /* TODO: Consider adding operation details (e.g. operations[] index)
132
+ /* Note: we must be selective about what PHPUnit exceptions to pass
133
+ * through, as PHPUnit's Warning exception must be considered for
134
+ * expectError in GridFS tests (see: PHPLIB-592).
135
+ *
136
+ * TODO: Consider adding operation details (e.g. operations[] index)
133
137
* to the exception message. Alternatively, throw a new exception
134
138
* and include this as the previous, since PHPUnit will render the
135
139
* chain when reporting a test failure. */
136
- if ($ e instanceof PHPUnitException ) {
140
+ if ($ e instanceof AssertionFailedError ) {
137
141
throw $ e ;
138
142
}
139
143
You can’t perform that action at this time.
0 commit comments