Skip to content

Commit d0a2879

Browse files
Gintautas MiselisTavoNiievez
Gintautas Miselis
authored andcommitted
Require bootstrap.php if exists
to load all necessary .env files
1 parent c97a29f commit d0a2879

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Codeception/Module/Symfony.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ public function _initialize(): void
186186
}
187187

188188
$this->kernel = new $this->kernelClass($this->config['environment'], $this->config['debug']);
189+
190+
$bootstrapFile = $this->kernel->getProjectDir() . '/config/bootstrap.php';
191+
if (file_exists($bootstrapFile)) {
192+
$_ENV['APP_ENV'] = $this->config['environment'];
193+
require $bootstrapFile;
194+
}
195+
189196
$this->kernel->boot();
190197

191198
if ($this->config['cache_router'] === true) {

0 commit comments

Comments
 (0)