New Branch Structure
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Stylist\Tests\Feature;
|
||||
|
||||
use Modules\Stylist\Theme\Loader;
|
||||
use Tests\TestCase;
|
||||
|
||||
final class ThemeAssetControllerTest extends TestCase
|
||||
{
|
||||
public function test_active_theme_css_is_served(): void
|
||||
{
|
||||
config(['stylist.themes_path' => resource_path('themes')]);
|
||||
app(Loader::class)->flush();
|
||||
|
||||
$this->get(route('stylist.theme.asset', [
|
||||
'theme' => 'saasland',
|
||||
'path' => 'css/theme.css',
|
||||
]))->assertOk()->assertHeader('X-Content-Type-Options', 'nosniff');
|
||||
}
|
||||
|
||||
public function test_asset_url_uses_public_themes_path(): void
|
||||
{
|
||||
$url = route('stylist.theme.asset', [
|
||||
'theme' => 'saasland',
|
||||
'path' => 'images/example.jpg',
|
||||
], false);
|
||||
|
||||
$this->assertSame('/themes/saasland/images/example.jpg', $url);
|
||||
}
|
||||
|
||||
public function test_non_asset_theme_files_are_not_served(): void
|
||||
{
|
||||
config(['stylist.themes_path' => resource_path('themes')]);
|
||||
app(Loader::class)->flush();
|
||||
|
||||
$this->get(route('stylist.theme.asset', [
|
||||
'theme' => 'saasland',
|
||||
'path' => 'views/home.blade.php',
|
||||
]))->assertNotFound();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user