koel/tests/Integration/Repositories/SongRepositoryTest.php
Javier López 7ba295efad Non interactive koel:init (#886)
* 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
2019-01-01 12:53:20 +01:00

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);
}
}