diff --git a/tests/unit/plugins/database/ModelTest.php b/tests/unit/plugins/database/ModelTest.php index 4742b73b6..16bf07c1d 100644 --- a/tests/unit/plugins/database/ModelTest.php +++ b/tests/unit/plugins/database/ModelTest.php @@ -23,12 +23,11 @@ class ModelTest extends PluginTestCase $this->assertEquals(1, $post->id); } - /** - * @expectedException \Illuminate\Database\Eloquent\MassAssignmentException - * @expectedExceptionMessage title - */ public function testGuardedAttribute() { + $this->expectException(\Illuminate\Database\Eloquent\MassAssignmentException::class); + $this->expectExceptionMessageMatches('/title/'); + Post::create(['title' => 'Hi!', 'slug' => 'authenticity']); } } diff --git a/tests/unit/plugins/database/SimpleTreeModelTest.php b/tests/unit/plugins/database/SimpleTreeModelTest.php index 31389dc0b..c22b11d16 100644 --- a/tests/unit/plugins/database/SimpleTreeModelTest.php +++ b/tests/unit/plugins/database/SimpleTreeModelTest.php @@ -165,12 +165,11 @@ class SimpleTreeModelTest extends PluginTestCase ], $array); } - /** - * @expectedException \Exception - * @expectedExceptionMessage Column mismatch in listsNested method - */ public function testListsNestedUnknownColumn() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Column mismatch in listsNested method'); + CategorySimple::listsNested('custom_name', 'id'); } diff --git a/tests/unit/plugins/database/ValidationModelTest.php b/tests/unit/plugins/database/ValidationModelTest.php index 4eba6d02c..f5ddb55b7 100644 --- a/tests/unit/plugins/database/ValidationModelTest.php +++ b/tests/unit/plugins/database/ValidationModelTest.php @@ -13,11 +13,10 @@ class ValidationModelTest extends PluginTestCase $this->runPluginRefreshCommand('Database.Tester'); } - /** - * @expectedException October\Rain\Database\ModelException - */ public function testUniqueTableValidation() { + $this->expectException(\October\Rain\Database\ModelException::class); + $post = ValidationPost::create([ 'title' => 'This is a new post', 'slug' => 'post-1',