From 05ba5c38d53627a1149ab5df9cd44f644200464a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEuris?= Date: Sat, 21 Oct 2023 15:45:44 +0300 Subject: [PATCH] Improve Laravel compatibility --- tests/TestCase.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 5f69163..5abf2aa 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -41,7 +41,10 @@ protected function getPackageAliases($app): array */ protected function getEnvironmentSetUp($app): void { - $app->instance('path.public', __DIR__.'/fixtures'); + if (method_exists($app, 'usePublicPath')) // Laravel 10 + $app->usePublicPath(__DIR__.'/fixtures'); + else // Laravel 8 & Laravel 9 + $app->instance('path.public', __DIR__.'/fixtures'); } /**