From 5efcd1be49093d6b411582f34d87d3df13444ec2 Mon Sep 17 00:00:00 2001 From: JosueGB Date: Thu, 23 Jun 2022 19:15:57 +0100 Subject: [PATCH] Added test for morph many not including type bug --- tests/Database/DatabaseEloquentMorphOneOfManyTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Database/DatabaseEloquentMorphOneOfManyTest.php b/tests/Database/DatabaseEloquentMorphOneOfManyTest.php index 4d98d120efd2..9a8e70f4c748 100644 --- a/tests/Database/DatabaseEloquentMorphOneOfManyTest.php +++ b/tests/Database/DatabaseEloquentMorphOneOfManyTest.php @@ -94,6 +94,15 @@ public function testMorphType() $this->assertSame('active', $product->current_state->state); } + public function testForceCreateMorphType() + { + $product = MorphOneOfManyTestProduct::create(); + $product->states()->forceCreate([ + 'state' => 'active', + ]); + $this->assertSame(MorphOneOfManyTestProduct::class, $product->current_state->stateful_type); + } + public function testExists() { $product = MorphOneOfManyTestProduct::create();