Skip to content

Commit 5efcd1b

Browse files
committed
Added test for morph many not including type bug
1 parent 1bbf549 commit 5efcd1b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Database/DatabaseEloquentMorphOneOfManyTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ public function testMorphType()
9494
$this->assertSame('active', $product->current_state->state);
9595
}
9696

97+
public function testForceCreateMorphType()
98+
{
99+
$product = MorphOneOfManyTestProduct::create();
100+
$product->states()->forceCreate([
101+
'state' => 'active',
102+
]);
103+
$this->assertSame(MorphOneOfManyTestProduct::class, $product->current_state->stateful_type);
104+
}
105+
97106
public function testExists()
98107
{
99108
$product = MorphOneOfManyTestProduct::create();

0 commit comments

Comments
 (0)