koel/tests/Unit/ApplicationTest.php
2022-10-07 16:25:44 +02:00

24 lines
640 B
PHP

<?php
namespace Tests\Unit;
use Tests\TestCase;
class ApplicationTest extends TestCase
{
public function testStaticUrlsWithoutCdnAreConstructedCorrectly(): void
{
config(['koel.cdn.url' => '']);
self::assertSame('http://localhost/', static_url());
self::assertSame('http://localhost/foo.css', static_url('/foo.css '));
}
public function testStaticUrlsWithCdnAreConstructedCorrectly(): void
{
config(['koel.cdn.url' => 'http://cdn.tld']);
self::assertSame('http://cdn.tld/', static_url());
self::assertSame('http://cdn.tld/foo.css', static_url('/foo.css '));
}
}