mirror of
https://github.com/archtechx/virtualcolumn.git
synced 2025-12-12 14:14:05 +00:00
Don't break with Model::shouldBeStrict()` enabled
This commit is contained in:
parent
7371aac2ab
commit
4a8031266f
3 changed files with 23 additions and 1 deletions
|
|
@ -128,6 +128,20 @@ class VirtualColumnTest extends TestCase
|
|||
$this->assertSame($encodedBar->bar, 'bar');
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function decoding_works_with_strict_mode_enabled() {
|
||||
FooModel::shouldBeStrict();
|
||||
|
||||
FooModel::create([
|
||||
'id' => 1,
|
||||
'foo' => 'bar'
|
||||
]);
|
||||
|
||||
$id = FooModel::query()->pluck('id')->first();
|
||||
|
||||
$this->assertSame(1, $id);
|
||||
}
|
||||
|
||||
// maybe add an explicit test that the saving() and updating() listeners don't run twice?
|
||||
|
||||
/** @test */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue