Yii 2 Codeception API Test
My API uses the Yii2 advanced template. It uses symfony/dotenv to read the .env. The .env is loaded in all the configurations. $dotenv = new Symfony\Component\Dotenv\Dotenv; $dotenv->load(__DIR__ . '/../../.env'); While running the Codeception api test, I came across this error. [PHPUnit\Framework\Exception] Undefined index: HOST at ../common/config/main-local.php:7 After much digging around, I’ve realized that I need to load Symfony\Component\Dotenv\Dotenv in common/config/codeception-local.php Thus, I have updated that file in the environment folder, and reran php init. ...