Download the PHP package manyapp/duskapiconf without Composer
On this page you can find all versions of the php package manyapp/duskapiconf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manyapp/duskapiconf
More information about manyapp/duskapiconf
Files in manyapp/duskapiconf
Package duskapiconf
Short Description Change your Laravel configuration for each Dusk test with an easy API
License mit
Informations about the package duskapiconf
A Laravel module to perform live configuration changes from your Dusk tests
The issue
Currently, the only way to define the configuration of your Laravel app during Dusk tests is to set the relevant variables in a dedicated .env.dusk.local
file. This file is copied and read during the application's boot, and therefore cannot be changed within Dusk tests.
This behaviour can be problematic, as a lot of developers need to change the configuration in specific tests to see if the application reacts accordingly.
As mentionned here, there is no easy way to tackle this problem.
The solution
This modules offers an easy possibility to change the configuration of your application during the runtime of your Dusk tests.
See how it works on our blog article.
Installation
Install the module with:
Then, you will have to modify your DustTestCase.php
to add three methods. Alternatively, you can add the following methods to the Trait of your choice and use the Trait in your Dusk tests.
Usage
To use it, use the defined methods below directly in your Dusk tests.
Change location of the config temporary file
Type the following commands:
Modify the Storage disk and the name of the temporary file.
Contribute
For any bug or feature request, use Github.
For any other feedback, let us a comment on this blog article or contact us.
License
MIT.