From cd61f6a3e1e83ff326d417c0bddb1c19b84e9426 Mon Sep 17 00:00:00 2001 From: Gintautas Miselis Date: Thu, 13 Feb 2020 15:02:12 +0200 Subject: [PATCH] Require bootstrap.php if exists to load all necessary .env files --- src/Codeception/Module/Symfony.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Codeception/Module/Symfony.php b/src/Codeception/Module/Symfony.php index 13a9f6d..5b7d799 100644 --- a/src/Codeception/Module/Symfony.php +++ b/src/Codeception/Module/Symfony.php @@ -202,6 +202,13 @@ public function _initialize(): void } $this->kernel = new $this->kernelClass($this->config['environment'], $this->config['debug']); + + $bootstrapFile = $this->kernel->getProjectDir() . '/config/bootstrap.php'; + if (file_exists($bootstrapFile)) { + $_ENV['APP_ENV'] = $this->config['environment']; + require $bootstrapFile; + } + $this->kernel->boot(); if ($this->config['cache_router'] === true) {