Answer the question
In order to leave comments, you need to log in
Why are the settings in phpunit.xml not being applied?
<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="test"/>
<env name="DB_TEST_DATABASE" value="test_database"/>
</php>
'connections' => [
'pgsql' => [
'driver' => 'pgsql',
'host' => env('POSTGRES_HOST', '127.0.0.1'),
'port' => env('POSTGRES_PORT', '5432'),
'database' => env('POSTGRES_DATABASE', 'forge'),
'username' => env('POSTGRES_USER', 'forge'),
'password' => env('POSTGRES_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'test' => [
'driver' => 'pgsql',
'host' => env('POSTGRES_HOST', '127.0.0.1'),
'port' => env('POSTGRES_PORT', '5432'),
'database' => env('DB_TEST_DATABASE', 'forge'),
'username' => env('POSTGRES_USER', 'forge'),
'password' => env('POSTGRES_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
],
Answer the question
In order to leave comments, you need to log in
The values from the .env variable will overwrite the values from phpunit.xml. I recommend creating a .env.testing file and overriding the corresponding variables there. Information about this is in the official documentation in the testing chapter .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question