Adding Spell Model
This commit is contained in:
parent
b7ccc4a657
commit
78d5d8d50e
3 changed files with 102 additions and 0 deletions
29
tests/Feature/Models/SpellTest.php
Normal file
29
tests/Feature/Models/SpellTest.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Models;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
use App\Models\Recipe;
|
||||
use App\Models\Spell;
|
||||
|
||||
class SpellTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* Test recipe relationship.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function test_recipe_relationship()
|
||||
{
|
||||
$spell = Spell::factory()->create();
|
||||
$recipe = Recipe::factory()
|
||||
->for($spell)
|
||||
->create();
|
||||
|
||||
$this->assertEquals($recipe->name, $spell->recipe->name);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue