koel/tests/Unit/Models/SongTest.php

26 lines
650 B
PHP
Raw Normal View History

2017-08-05 16:56:11 +00:00
<?php
2022-07-29 06:47:10 +00:00
namespace Tests\Unit\Models;
2017-08-05 16:56:11 +00:00
use App\Models\Song;
use Tests\TestCase;
class SongTest extends TestCase
{
public function testGettingS3HostedSongs(): void
2017-12-09 22:39:34 +00:00
{
/** @var Song $song */
$song = Song::factory()->create(['path' => 's3://foo/bar']);
2017-12-09 22:39:34 +00:00
self::assertEquals(['bucket' => 'foo', 'key' => 'bar'], $song->s3_params);
2017-12-09 22:39:34 +00:00
}
public function testLyricsDoNotContainTimestamps(): void
{
/** @var Song $song */
$song = Song::factory()->create(['lyrics' => "[00:00.00]Line 1\n[00:01.00]Line 2\n[00:02.00]Line 3"]);
self::assertEquals("Line 1\nLine 2\nLine 3", $song->lyrics);
}
2017-08-05 16:56:11 +00:00
}