From e26284102baf3f2c28dd2546a93d4dbd14351b74 Mon Sep 17 00:00:00 2001 From: SonyPradana Date: Tue, 28 May 2024 20:36:10 +0700 Subject: [PATCH] fix: resolve base path delimater --- src/System/Integrate/Application.php | 2 +- tests/Integrate/Bootstrap/ConfigProvidersTest.php | 4 ++-- .../Bootstrap/{bootsrap => bootstrap}/cache/config.php | 0 tests/Integrate/Commands/ConfigCommandTest.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename tests/Integrate/Bootstrap/{bootsrap => bootstrap}/cache/config.php (100%) diff --git a/src/System/Integrate/Application.php b/src/System/Integrate/Application.php index 2ebf58b6..88388eb7 100644 --- a/src/System/Integrate/Application.php +++ b/src/System/Integrate/Application.php @@ -649,7 +649,7 @@ public function appPath() */ public function getApplicationCachePath() { - return $this->basePath() . 'bootsrap' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR; + return rtrim($this->basePath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'bootstrap' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR; } /** diff --git a/tests/Integrate/Bootstrap/ConfigProvidersTest.php b/tests/Integrate/Bootstrap/ConfigProvidersTest.php index b46c39ec..2172f4c8 100644 --- a/tests/Integrate/Bootstrap/ConfigProvidersTest.php +++ b/tests/Integrate/Bootstrap/ConfigProvidersTest.php @@ -14,7 +14,7 @@ class ConfigProvidersTest extends TestCase */ public function itCanLoadConfigFromDefault() { - $app = new Application(__DIR__); + $app = new Application('/'); (new ConfigProviders())->bootstrap($app); /** @var Config */ @@ -49,7 +49,7 @@ public function itCanLoadConfigFromFile() */ public function itCanLoadConfigFromCache() { - $app = new Application(__DIR__ . DIRECTORY_SEPARATOR); + $app = new Application(__DIR__); $app->setConfigPath(DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR); (new ConfigProviders())->bootstrap($app); diff --git a/tests/Integrate/Bootstrap/bootsrap/cache/config.php b/tests/Integrate/Bootstrap/bootstrap/cache/config.php similarity index 100% rename from tests/Integrate/Bootstrap/bootsrap/cache/config.php rename to tests/Integrate/Bootstrap/bootstrap/cache/config.php diff --git a/tests/Integrate/Commands/ConfigCommandTest.php b/tests/Integrate/Commands/ConfigCommandTest.php index 84b4a884..ec73933a 100644 --- a/tests/Integrate/Commands/ConfigCommandTest.php +++ b/tests/Integrate/Commands/ConfigCommandTest.php @@ -23,7 +23,7 @@ protected function tearDown(): void */ public function itCanCreateConfigFile() { - $app = new Application(dirname(__DIR__) . DIRECTORY_SEPARATOR); + $app = new Application(dirname(__DIR__)); $app->setConfigPath(DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR); @@ -44,7 +44,7 @@ public function itCanCreateConfigFile() */ public function itCanRemoveConfigFile() { - $app = new Application(dirname(__DIR__) . DIRECTORY_SEPARATOR); + $app = new Application(dirname(__DIR__)); $app->setConfigPath(DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'Config' . DIRECTORY_SEPARATOR);