New parameters added to app.php file are not accessible from Dusk tests
Closed this issue · 2 comments
Laravel Version
11.25
PHP Version
8.3.3
Database Driver & Version
No response
Description
After upgrading Laravel from version 10 to 11 and Dusk from version 7 to 8, I can no longer access custom configuration keys added to the ./config/app.php file
. For example:
<?php
use Illuminate\Support\Facades\Facade;
dump('Config file loaded');
return [
'test' => 'Hello!',
'locale' => 'en',
...
When I call dd(config('app.test'));
in the Feature test file ./tests/Feature/ApiTest.php
, I see "Hello!"
in the terminal.
When I call dd(config('app.test'));
in the controller, I see "Hello!"
in the browser.
The problem is here.
When I call dd(config('app.locale'));
in the browser test file ./tests/Browser/CommentsTest.php
, I see "en"
in the terminal, but if I call dd(config('app.test'));
, I see null
.
Why is this happening?
Steps To Reproduce
Additional information:
The message 'Config file loaded'
is successfully displayed in the terminal and browser after running any of the mentioned variants.
When calling dd(config()->all());
in the ./tests/Browser/CommentsTest.php
file, my new fields are also not visible.
Using Config::get('app.test')
also returns null.
For browser tests, I use a separate configuration file .env.dusk.local
, which is successfully converted to .env
during test execution.
Commands like php artisan config:clear
or php artisan cache:clear
do not produce any results.
Hey there, thanks for reporting this issue.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new bug-report --github="--public"
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
Hey there,
We're closing this issue because it's inactive, already solved, old, or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem.