Hi there,
I’m working on an app based on the advanced application template.
I am using codeception and would like to use the Db module. It is configured in the suite configuration yaml file.
To keep the database configuration out of the repository, I am trying to put the password into a codeception param file, as described in "Modules And Helper: Dynamic Configuration With Params" in the codeception docs. However, codeception does not seem to read my parameters.
I have in tests/codeception/frontend/codeception.yml
params:
- .env
The file tests/codeception/frontend/.env:
DB_USERNAME=homestead
DB_PASSWORD=secret
and in the suite configuration
Db:
dsn: 'mysql:host=localhost;dbname=testingdb'
user: "%DB_USERNAME%"
password: "DB_PASSWORD"
dump: '../_data/base.sql'
populate: true
cleanup: false
reconnect: true
The result is:
Db: SQLSTATE[28000] [1045] Access denied for user '%DB_USERNAME%'@'localhost' (using password: YES) while creating PDO connection
There is no error that the params file was not found or anything else that would help…
Any help with this would be very much appreciated!