Fix more exception tests
This commit is contained in:
parent
2c529cf753
commit
a4c34d1dea
|
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue