From d5924445a8b414f51dd57334c4d1fd670b31c646 Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Sun, 26 Jan 2020 00:12:14 -0700 Subject: [PATCH] Added subdirectory test to asset view function test --- tests/ViewFunctions/AssetTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/ViewFunctions/AssetTest.php b/tests/ViewFunctions/AssetTest.php index 0d66644..666e4d9 100644 --- a/tests/ViewFunctions/AssetTest.php +++ b/tests/ViewFunctions/AssetTest.php @@ -14,4 +14,14 @@ class AssetTest extends TestCase $this->assertEquals('/app/dist/css/app.css', $asset('css/app.css')); $this->assertEquals('/app/dist/js/app.js', $asset('js/app.js')); } + + public function test_it_can_return_an_asset_with_a_subdirectory(): void + { + $_SERVER['SCRIPT_NAME'] = '/some/dir/index.php'; + + $asset = new Asset($this->container, $this->config); + + $this->assertEquals('/some/dir/app/dist/css/app.css', $asset('css/app.css')); + $this->assertEquals('/some/dir/app/dist/js/app.js', $asset('js/app.js')); + } }