mirror of
https://github.com/koel/koel
synced 2024-12-24 11:33:05 +00:00
30 lines
676 B
PHP
30 lines
676 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Services;
|
|
|
|
use App\Services\SimpleLrcReader;
|
|
use Illuminate\Support\Str;
|
|
use Tests\TestCase;
|
|
|
|
class SimpleLrcReaderTest extends TestCase
|
|
{
|
|
private SimpleLrcReader $reader;
|
|
|
|
public function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->reader = new SimpleLrcReader();
|
|
}
|
|
|
|
public function testTryReadForMediaFile(): void
|
|
{
|
|
$base = sys_get_temp_dir() . '/' . Str::uuid();
|
|
$lrcFile = $base . '.lrc';
|
|
|
|
copy(__DIR__ . '/../../blobs/simple.lrc', $lrcFile);
|
|
|
|
self::assertSame("Line 1\nLine 2\nLine 3", $this->reader->tryReadForMediaFile($base . '.mp3'));
|
|
@unlink($lrcFile);
|
|
}
|
|
}
|