diff --git a/src/Codeception/Lib/Connector/Laravel5.php b/src/Codeception/Lib/Connector/Laravel5.php index cac91f9..fb407ba 100644 --- a/src/Codeception/Lib/Connector/Laravel5.php +++ b/src/Codeception/Lib/Connector/Laravel5.php @@ -192,10 +192,11 @@ private function initialize($request = null) $this->app = $this->kernel = $this->loadApplication(); + $this->app->make('Illuminate\Contracts\Http\Kernel')->bootstrap(); + // Set the request instance for the application, if (is_null($request)) { - $appConfig = require $this->module->config['project_dir'] . 'config/app.php'; - $request = SymfonyRequest::create($appConfig['url']); + $request = SymfonyRequest::create($this->app['config']->get('app.url')); } $this->app->instance('request', Request::createFromBase($request)); @@ -208,8 +209,6 @@ private function initialize($request = null) }); } - $this->app->make('Illuminate\Contracts\Http\Kernel')->bootstrap(); - // Record all triggered events by adding a wildcard event listener // Since Laravel 5.4 wildcard event handlers receive the event name as the first argument, // but for earlier Laravel versions the firing() method of the event dispatcher should be used