koel/tests/Unit/ApplicationTest.php

25 lines
640 B
PHP
Raw Normal View History

2017-06-10 15:30:54 +00:00
<?php
namespace Tests\Unit;
use Tests\TestCase;
class ApplicationTest extends TestCase
{
public function testStaticUrlsWithoutCdnAreConstructedCorrectly(): void
2017-06-10 15:30:54 +00:00
{
config(['koel.cdn.url' => '']);
2022-10-07 14:25:44 +00:00
self::assertSame('http://localhost/', static_url());
self::assertSame('http://localhost/foo.css', static_url('/foo.css '));
2017-06-10 15:30:54 +00:00
}
public function testStaticUrlsWithCdnAreConstructedCorrectly(): void
2017-06-10 15:30:54 +00:00
{
config(['koel.cdn.url' => 'http://cdn.tld']);
2022-10-07 14:25:44 +00:00
self::assertSame('http://cdn.tld/', static_url());
self::assertSame('http://cdn.tld/foo.css', static_url('/foo.css '));
2017-06-10 15:30:54 +00:00
}
}