app/Models/Recipe.php: add spell relationship.
This commit is contained in:
parent
78d5d8d50e
commit
86a0474a89
3 changed files with 29 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ use App\Models\RecipeCategory;
|
|||
use App\Models\Profession;
|
||||
use App\Models\CharacterProfession;
|
||||
use App\Models\Character;
|
||||
use App\Models\Spell;
|
||||
use App\Models\Item;
|
||||
|
||||
class RecipeTest extends TestCase
|
||||
|
|
@ -48,6 +49,22 @@ class RecipeTest extends TestCase
|
|||
$this->assertEquals($category->id, $recipe->category->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test spell relationship.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function test_spell_relationship()
|
||||
{
|
||||
$spell = Spell::factory()->create();
|
||||
|
||||
$recipe = Recipe::factory()
|
||||
->for($spell)
|
||||
->create();
|
||||
|
||||
$this->assertEquals($spell->id, $recipe->spell->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test craft relationship.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue