Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"php": "^8.0",
"ext-json": "*",
"codeception/lib-innerbrowser": "^3.1",
"codeception/codeception": "^5.0.0-RC2"
"codeception/codeception": "^5.0.0-RC2",
"vlucas/phpdotenv": "^5.3"
},
"require-dev": {
"codeception/module-asserts": "^3.0",
"codeception/module-rest": "^3.1",
"laravel/framework": "^8.0",
"vlucas/phpdotenv": "^5.3"
"laravel/framework": "^8.0"
},
"autoload": {
"classmap": ["src/"]
Expand Down
8 changes: 7 additions & 1 deletion src/Codeception/Lib/Connector/Laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Codeception\Lib\Connector\Laravel6\ExceptionHandlerDecorator as Laravel6ExceptionHandlerDecorator;
use Codeception\Module\Laravel as LaravelModule;
use Codeception\Stub;
use Dotenv\Dotenv;
use Exception;
use Illuminate\Contracts\Config\Repository as Config;
use Illuminate\Contracts\Debug\ExceptionHandler;
Expand Down Expand Up @@ -186,7 +187,12 @@ private function loadApplication(): AppContract
{
/** @var AppContract $app */
$app = require $this->module->config['bootstrap_file'];
$app->loadEnvironmentFrom($this->module->config['environment_file']);
if ($this->module->config['environment_file'] !== '.env') {
Dotenv::createMutable(
$app->basePath(),
$this->module->config['environment_file']
)->load();
}
$app->instance('request', new Request());

return $app;
Expand Down