I'm using Codeception, which leverages PHPUnit as its unit testing framework, and have a number of unit tests
I recently updated my database connection using connection info stored in the php configuration file (rather than hard-coded).
$host = getenv('RDS_HOST');
$user = getenv('RDS_USER');
$password = getenv('RDS_PASSWORD');
$schema = getenv('RDS_SCHEMA');
$mysqli = new \mysqli($host, $user, $password, $schema);
My app works just fine after these changes.
Problem is, many of my unit tests are now broken, running unit tests results in the error message:
[PHPUnit_Framework_Exception] mysqli::mysqli(): (HY000/2002): No such file or directory
I created unit tests just to see if PHPUnit will read my environment variables. It appears that it does not. It seems that PHPUnit is ignoring my environment variables.
How can I get PHPUnit/Codeception to recognize and use Apache environment variables?