Skip to content

Commit a7e9e08

Browse files
author
Erik Galloway
committed
Update readme example to use correct default assertion method
1 parent 29deae8 commit a7e9e08

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

readme.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ Class UserModelTest extends \EGALL\EloquentPHPUnit\EloquentTestCase {
5656
$this->table->column('password')->string()->notNullable();
5757
$this->table->column('dob')->date()->nullable();
5858
$this->table->column('avatar_id')->integer()->foreign('images', 'id', $onUpdate = 'cascade', $onDelete = 'cascade');
59-
$this->table->column('is_verified')->boolean()->default(false);
60-
$this->table->column('is_admin')->boolean()->default(false);
59+
$this->table->column('is_verified')->boolean()->defaults(false);
60+
$this->table->column('is_admin')->boolean()->defaults(false);
6161
$this->table->column('verification_sent_at')->dateTime()->nullable();
6262
$this->table->column('invite_sent_at')->dateTime()->nullable();
6363
$this->table->column('api_token')->string()->index();
@@ -71,14 +71,16 @@ Class UserModelTest extends \EGALL\EloquentPHPUnit\EloquentTestCase {
7171
public function testModelProperties() {
7272
$this->hasFillable('name', 'email', 'password', 'dob', 'avatar_id')
7373
->hasHidden('password', 'remember_token')
74-
->hasCasts('is_verified', 'boolean') // or
74+
->hasCasts('is_verified', 'boolean')
75+
// or
7576
->hasCasts(['is_verified' => 'boolean', 'is_admin' => 'boolean'])
7677
->hasDates('verification_sent_at', 'invite_sent_at')
77-
->belongsTo(Image::class) // if method name = 'image()' or
78+
->belongsTo(Image::class)
79+
// if method name = 'image()' or
7880
->belongsTo(Image::class, $customMethod = 'avatar')
7981
->hasMany(Profile::class)
80-
->morphsTo($method = 'slug', $morphTo = 'sluggable') // or
81-
// example below assumes the db fields are: 'sluggable_id' and 'sluggable_type'
82+
->morphsTo($method = 'slug', $morphTo = 'sluggable')
83+
// or: example below assumes the db fields are: 'sluggable_id' and 'sluggable_type'
8284
->morphsTo('sluggable');
8385
}
8486
}

0 commit comments

Comments
 (0)