Skip to content

Commit

Permalink
Added test for morph many not including type bug
Browse files Browse the repository at this point in the history
  • Loading branch information
josue-itg committed Jun 23, 2022
1 parent 1bbf549 commit 5efcd1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Database/DatabaseEloquentMorphOneOfManyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 5efcd1b

Please sign in to comment.