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
|
|
|
|
{
|
2024-06-04 11:10:44 +00:00
|
|
|
public function testRetrievedLyricsDoNotContainTimestamps(): void
|
2022-09-14 12:12:06 +00:00
|
|
|
{
|
|
|
|
/** @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"]);
|
|
|
|
|
2022-10-07 14:25:44 +00:00
|
|
|
self::assertSame("Line 1\nLine 2\nLine 3", $song->lyrics);
|
2024-06-04 11:10:44 +00:00
|
|
|
self::assertSame("[00:00.00]Line 1\n[00:01.00]Line 2\n[00:02.00]Line 3", $song->getAttributes()['lyrics']);
|
2022-09-14 12:12:06 +00:00
|
|
|
}
|
2017-08-05 16:56:11 +00:00
|
|
|
}
|