-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b023d60
commit 65e3a52
Showing
6 changed files
with
70 additions
and
12 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
22 changes: 22 additions & 0 deletions
22
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,22 @@ | ||
<?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,11 @@ | ||
<?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,12 @@ | ||
<?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,11 @@ | ||
<?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