@@ -503,13 +503,14 @@ public function testDontThrowExceptionWhenSoftDeleteConditionIsSetWithEmptyValue
503503 } //--------------------------------------------------------------------
504504
505505 /**
506- * @expectedException \CodeIgniter\Database\Exceptions\DatabaseException
507- * @expectedExceptionMessage Deletes are not allowed unless they contain a "where" or "like" clause.
508506 * @dataProvider emptyPkValues
509507 * @return void
510508 */
511509 public function testThrowExceptionWhenSoftDeleteParamIsEmptyValue ($ emptyValue )
512510 {
511+ $ this ->expectException ('CodeIgniter\Database\Exceptions\DatabaseException ' );
512+ $ this ->expectExceptionMessage ('Deletes are not allowed unless they contain a "where" or "like" clause. ' );
513+
513514 $ model = new UserModel ();
514515 $ this ->seeInDatabase ('user ' , ['name ' => 'Derek Jones ' , 'deleted_at IS NULL ' => null ]);
515516 $ model ->delete ($ emptyValue );
@@ -518,13 +519,14 @@ public function testThrowExceptionWhenSoftDeleteParamIsEmptyValue($emptyValue)
518519 //--------------------------------------------------------------------
519520
520521 /**
521- * @expectedException \CodeIgniter\Database\Exceptions\DatabaseException
522- * @expectedExceptionMessage Deletes are not allowed unless they contain a "where" or "like" clause.
523522 * @dataProvider emptyPkValues
524523 * @return void
525524 */
526525 public function testDontDeleteRowsWhenSoftDeleteParamIsEmpty ($ emptyValue )
527526 {
527+ $ this ->expectException ('CodeIgniter\Database\Exceptions\DatabaseException ' );
528+ $ this ->expectExceptionMessage ('Deletes are not allowed unless they contain a "where" or "like" clause. ' );
529+
528530 $ model = new UserModel ();
529531 $ this ->seeInDatabase ('user ' , ['name ' => 'Derek Jones ' , 'deleted_at IS NULL ' => null ]);
530532 $ model ->delete ($ emptyValue );
@@ -1262,12 +1264,11 @@ public function testValidationIncludingErrors()
12621264
12631265 //--------------------------------------------------------------------
12641266
1265- /**
1266- * @expectedException \CodeIgniter\Exceptions\ModelException
1267- * @expectedExceptionMessage `Tests\Support\Models\UserModel` model class does not specify a Primary Key.
1268- */
12691267 public function testThrowsWithNoPrimaryKey ()
12701268 {
1269+ $ this ->expectException ('CodeIgniter\Exceptions\ModelException ' );
1270+ $ this ->expectExceptionMessage ('`Tests\Support\Models\UserModel` model class does not specify a Primary Key. ' );
1271+
12711272 $ model = new UserModel ();
12721273 $ this ->setPrivateProperty ($ model , 'primaryKey ' , '' );
12731274
@@ -1276,12 +1277,11 @@ public function testThrowsWithNoPrimaryKey()
12761277
12771278 //--------------------------------------------------------------------
12781279
1279- /**
1280- * @expectedException \CodeIgniter\Exceptions\ModelException
1281- * @expectedExceptionMessage `Tests\Support\Models\UserModel` model class does not have a valid dateFormat.
1282- */
12831280 public function testThrowsWithNoDateFormat ()
12841281 {
1282+ $ this ->expectException ('CodeIgniter\Exceptions\ModelException ' );
1283+ $ this ->expectExceptionMessage ('`Tests\Support\Models\UserModel` model class does not have a valid dateFormat. ' );
1284+
12851285 $ model = new UserModel ();
12861286 $ this ->setPrivateProperty ($ model , 'dateFormat ' , '' );
12871287
0 commit comments