Add tests for Taggable model

This commit is contained in:
James Brooks
2018-04-02 18:21:58 +01:00
parent 737dd689b0
commit 785f2391f3
2 changed files with 45 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
namespace CachetHQ\Cachet\Models;
use AltThree\TestBench\ValidationTrait;
use Illuminate\Database\Eloquent\Model;
/**
@@ -20,6 +21,8 @@ use Illuminate\Database\Eloquent\Model;
*/
class Taggable extends Model
{
use ValidationTrait;
/**
* The attributes that should be casted to native types.
*
@@ -43,6 +46,17 @@ class Taggable extends Model
'taggable_type',
];
/**
* The validation rules.
*
* @var string[]
*/
public $rules = [
'tag_id' => 'required|int',
'taggable_id' => 'required|int',
'taggable_type' => 'required|string',
];
/**
* Get the tag relation.
*