koel/tests/Integration/Repositories/SongRepositoryTest.php

27 lines
587 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 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
2022-07-07 10:59:56 +00:00
$this->songRepository = app(SongRepository::class);
2018-08-29 06:15:11 +00:00
}
public function testGetOneByPath(): void
{
/** @var Song $song */
$song = Song::factory()->create(['path' => 'foo']);
self::assertSame($song->id, $this->songRepository->findOneByPath('foo')->id);
2018-08-29 06:15:11 +00:00
}
}