koel/tests/Integration/Repositories/SongRepositoryTest.php

28 lines
617 B
PHP
Raw Normal View History

2018-08-29 06:15:11 +00:00
<?php
namespace Tests\Integration\Repositories;
use App\Models\Song;
use App\Repositories\SongRepository;
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
$this->songRepository = new SongRepository(new Helper());
2018-08-29 06:15:11 +00:00
}
public function testGetOneByPath(): void
{
/** @var Song $song */
$song = Song::factory()->create(['path' => 'foo']);
2018-08-29 06:15:11 +00:00
self::assertSame($song->id, $this->songRepository->getOneByPath('foo')->id);
}
}