mirror of
https://github.com/koel/koel
synced 2024-12-20 01:23:16 +00:00
27 lines
656 B
PHP
27 lines
656 B
PHP
<?php
|
|
|
|
namespace Tests\Integration\Models;
|
|
|
|
use App\Models\Song;
|
|
use Tests\TestCase;
|
|
|
|
class SongTest extends TestCase
|
|
{
|
|
public function testLyricsHaveNewlinesReplacedByBrTags()
|
|
{
|
|
/** @var Song $song */
|
|
$song = Song::factory()->create([
|
|
'lyrics' => "foo\rbar\nbaz\r\nqux",
|
|
]);
|
|
|
|
self::assertEquals('foo<br />bar<br />baz<br />qux', $song->lyrics);
|
|
}
|
|
|
|
public function testGettingS3HostedSongs(): void
|
|
{
|
|
/** @var Song $song */
|
|
$song = Song::factory()->create(['path' => 's3://foo/bar']);
|
|
|
|
self::assertEquals(['bucket' => 'foo', 'key' => 'bar'], $song->s3_params);
|
|
}
|
|
}
|