diff --git a/tests/_support/_bootstrap.php b/tests/_support/_bootstrap.php index 896f0e6428a5..272ef3eb25e6 100644 --- a/tests/_support/_bootstrap.php +++ b/tests/_support/_bootstrap.php @@ -85,6 +85,19 @@ require COMPOSER_PATH; } +// Load environment settings from .env files +// into $_SERVER and $_ENV +require BASEPATH . 'Config/DotEnv.php'; + +$env = new \CodeIgniter\Config\DotEnv(ROOTPATH); +$env->load(); + +// Set environment values that would otherwise stop the framework from functioning during tests. +if (! isset($_SERVER['app.baseURL'])) +{ + $_SERVER['app.baseURL'] = 'http://example.com'; +} + /* * --------------------------------------------------------------- * GRAB OUR CODEIGNITER INSTANCE