koel/tests/Unit/ApplicationTest.php

25 lines
648 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' => '']);
2020-12-22 23:01:49 +00:00
self::assertEquals('http://localhost/', static_url());
self::assertEquals('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']);
2020-12-22 23:01:49 +00:00
self::assertEquals('http://cdn.tld/', static_url());
self::assertEquals('http://cdn.tld/foo.css', static_url('/foo.css '));
2017-06-10 15:30:54 +00:00
}
}