mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
23 lines
686 B
PHP
23 lines
686 B
PHP
<?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);
|
|
});
|