mirror of
https://github.com/koel/koel
synced 2024-12-05 02:09:54 +00:00
7ba295efad
* Use ADMIN_* variables if available to create the admin account * Add APP_MEDIA_PATH for media directory * Use the standard --no-interaction flag to koel:init * Undo variable aligment and code formatting * Prefer early return over else, add new line before return statements * Some fixes
35 lines
781 B
PHP
35 lines
781 B
PHP
<?php
|
|
|
|
namespace Tests\Integration\Repositories;
|
|
|
|
use App\Models\Song;
|
|
use App\Repositories\SongRepository;
|
|
use App\Services\HelperService;
|
|
use Tests\TestCase;
|
|
|
|
class SongRepositoryTest extends TestCase
|
|
{
|
|
/**
|
|
* @var HelperService
|
|
*/
|
|
private $helperService;
|
|
|
|
/**
|
|
* @var SongRepository
|
|
*/
|
|
private $songRepository;
|
|
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
$this->helperService = new HelperService();
|
|
$this->songRepository = new SongRepository($this->helperService);
|
|
}
|
|
|
|
public function testGetOneByPath(): void
|
|
{
|
|
/** @var Song $song */
|
|
$song = factory(Song::class)->create(['path' => 'foo']);
|
|
self::assertSame($song->id, $this->songRepository->getOneByPath('foo')->id);
|
|
}
|
|
}
|