2018-08-29 06:15:11 +00:00
|
|
|
<?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;
|
|
|
|
|
2019-07-22 07:03:23 +00:00
|
|
|
public function setUp(): void
|
2018-08-29 06:15:11 +00:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
$this->helperService = new HelperService();
|
2019-01-01 11:53:20 +00:00
|
|
|
$this->songRepository = new SongRepository($this->helperService);
|
2018-08-29 06:15:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetOneByPath(): void
|
|
|
|
{
|
|
|
|
/** @var Song $song */
|
|
|
|
$song = factory(Song::class)->create(['path' => 'foo']);
|
|
|
|
self::assertSame($song->id, $this->songRepository->getOneByPath('foo')->id);
|
|
|
|
}
|
|
|
|
}
|