2018-08-29 06:15:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Integration\Repositories;
|
|
|
|
|
|
|
|
use App\Models\Song;
|
|
|
|
use App\Repositories\SongRepository;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class SongRepositoryTest extends TestCase
|
|
|
|
{
|
2021-06-05 10:47:56 +00:00
|
|
|
private SongRepository $songRepository;
|
2018-08-29 06:15:11 +00:00
|
|
|
|
2019-07-22 07:03:23 +00:00
|
|
|
public function setUp(): void
|
2018-08-29 06:15:11 +00:00
|
|
|
{
|
|
|
|
parent::setUp();
|
2020-12-22 20:11:22 +00:00
|
|
|
|
2022-07-07 10:59:56 +00:00
|
|
|
$this->songRepository = app(SongRepository::class);
|
2018-08-29 06:15:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetOneByPath(): void
|
|
|
|
{
|
|
|
|
/** @var Song $song */
|
2020-11-14 16:57:25 +00:00
|
|
|
$song = Song::factory()->create(['path' => 'foo']);
|
2024-02-04 20:31:01 +00:00
|
|
|
self::assertSame($song->id, $this->songRepository->findOneByPath('foo')->id);
|
2018-08-29 06:15:11 +00:00
|
|
|
}
|
|
|
|
}
|