-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/onboard-duster
- Loading branch information
Showing
6 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/Features/ChildModelFillablesMergeWithParentModelFillablesTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Parental\Tests\Features; | ||
|
||
use Parental\Tests\Models\Event; | ||
use Parental\Tests\Models\Workshop; | ||
use Parental\Tests\TestCase; | ||
|
||
class ChildModelFillablesMergeWithParentModelFillablesTest extends TestCase | ||
{ | ||
/** @test */ | ||
function child_fillables_are_merged_with_parent_fillables() | ||
{ | ||
$workshop = Workshop::create([ | ||
'name' => 'Scaling Laravel', | ||
'industry' => 'Technology', | ||
'skill_level' => 'Advanced', | ||
]); | ||
|
||
$event = Event::first(); | ||
|
||
$this->assertEquals($event->name, $workshop->name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Parental\Tests\Models; | ||
|
||
use Parental\HasParent; | ||
|
||
class Conference extends Event | ||
{ | ||
use HasParent; | ||
|
||
protected $fillable = ['industry']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Parental\Tests\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Event extends Model | ||
{ | ||
protected $fillable = ['name', 'type']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Parental\Tests\Models; | ||
|
||
use Parental\HasParent; | ||
|
||
class Workshop extends Event | ||
{ | ||
use HasParent; | ||
|
||
protected $fillable = ['industry', 'skill_level']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters