File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,12 +186,14 @@ public function testThrowExceptionWhenSoftDeleteParamIsEmptyValue($emptyValue):
186186 */
187187 public function testDontDeleteRowsWhenSoftDeleteParamIsEmpty ($ emptyValue ): void
188188 {
189- $ this ->expectException (DatabaseException::class);
190- $ this ->expectExceptionMessage ('Deletes are not allowed unless they contain a "where" or "like" clause. ' );
191-
192189 $ this ->seeInDatabase ('user ' , ['name ' => 'Derek Jones ' , 'deleted_at IS NULL ' => null ]);
193190
194- $ this ->createModel (UserModel::class)->delete ($ emptyValue );
191+ try {
192+ $ this ->createModel (UserModel::class)->delete ($ emptyValue );
193+ } catch (DatabaseException $ e ) {
194+ // Do nothing.
195+ }
196+
195197 $ this ->seeInDatabase ('user ' , ['name ' => 'Derek Jones ' , 'deleted_at IS NULL ' => null ]);
196198 }
197199
You can’t perform that action at this time.
0 commit comments