Skip to content

Commit e3776c3

Browse files
author
Alexey Shapilov
committed
Loading Laravel Kernel (to load environment variables from file) before reading the application configuration from config/app.php
1 parent bd2c604 commit e3776c3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Codeception/Lib/Connector/Laravel5.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,11 @@ private function initialize($request = null)
192192

193193
$this->app = $this->kernel = $this->loadApplication();
194194

195+
$this->app->make('Illuminate\Contracts\Http\Kernel')->bootstrap();
196+
195197
// Set the request instance for the application,
196198
if (is_null($request)) {
197-
$appConfig = require $this->module->config['project_dir'] . 'config/app.php';
198-
$request = SymfonyRequest::create($appConfig['url']);
199+
$request = SymfonyRequest::create($this->app['config']->get('app.url'));
199200
}
200201
$this->app->instance('request', Request::createFromBase($request));
201202

@@ -208,8 +209,6 @@ private function initialize($request = null)
208209
});
209210
}
210211

211-
$this->app->make('Illuminate\Contracts\Http\Kernel')->bootstrap();
212-
213212
// Record all triggered events by adding a wildcard event listener
214213
// Since Laravel 5.4 wildcard event handlers receive the event name as the first argument,
215214
// but for earlier Laravel versions the firing() method of the event dispatcher should be used

0 commit comments

Comments
 (0)