Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the testing environment file specified in a suite #45

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 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,10 @@ 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') {
$env = Dotenv::createMutable($app->basePath(), $this->module->config['environment_file']);
$env->load();
}
$app->instance('request', new Request());

return $app;
Expand Down