dimanche 3 novembre 2019

Why would PHPunit ignore .env.testing?

I have a newly installed Laravel 6.4 application running and now trying to get tests working with PHPunit. I want to make configuration changes in .env.testing but any changes in here seem to be ignored.

phpunit.xml contains this:

    <php>
    <server name="APP_ENV" value="testing"/>
    <server name="BCRYPT_ROUNDS" value="4"/>
    <server name="CACHE_DRIVER" value="array"/>
    <server name="MAIL_DRIVER" value="array"/>
    <server name="QUEUE_CONNECTION" value="sync"/>
    <server name="SESSION_DRIVER" value="array"/>
</php>

And I have also have included $app->loadEnvironmentFrom('/var/www/api/.env.testing'); into tests/CreatesApplication.php createApplication() method. All paths are correct so I don't understand why it is not reading the file. I've found similar mentions of this issue when googling but none have helped me resolve the issue.

I am running PHPunit with the command vendor/bin/phpunit. Does anyone have suggestions on what I can try?

Aucun commentaire:

Enregistrer un commentaire