mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 23:18:10 +00:00
tests: add test for models Plugin, Playlist, PlaylistItem
This commit is contained in:
parent
ec862942cd
commit
2ef028527f
5 changed files with 118 additions and 1 deletions
24
tests/Unit/Models/PlaylistItemTest.php
Normal file
24
tests/Unit/Models/PlaylistItemTest.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Playlist;
|
||||
use App\Models\PlaylistItem;
|
||||
use App\Models\Plugin;
|
||||
|
||||
|
||||
test('playlist item belongs to playlist', function () {
|
||||
$playlist = Playlist::factory()->create();
|
||||
$playlistItem = PlaylistItem::factory()->create(['playlist_id' => $playlist->id]);
|
||||
|
||||
expect($playlistItem->playlist)
|
||||
->toBeInstanceOf(Playlist::class)
|
||||
->id->toBe($playlist->id);
|
||||
});
|
||||
|
||||
test('playlist item belongs to plugin', function () {
|
||||
$plugin = Plugin::factory()->create();
|
||||
$playlistItem = PlaylistItem::factory()->create(['plugin_id' => $plugin->id]);
|
||||
|
||||
expect($playlistItem->plugin)
|
||||
->toBeInstanceOf(Plugin::class)
|
||||
->id->toBe($plugin->id);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue