2018-08-29 06:15:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Integration\Repositories;
|
|
|
|
|
|
|
|
use App\Models\Song;
|
|
|
|
use App\Repositories\SongRepository;
|
2021-12-06 16:12:47 +00:00
|
|
|
use App\Services\Helper;
|
2018-08-29 06:15:11 +00:00
|
|
|
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
|
|
|
|
2021-12-06 16:12:47 +00:00
|
|
|
$this->songRepository = new SongRepository(new Helper());
|
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']);
|
2018-08-29 06:15:11 +00:00
|
|
|
self::assertSame($song->id, $this->songRepository->getOneByPath('foo')->id);
|
|
|
|
}
|
|
|
|
}
|