From fc8cdc87cc08f28b131fe17b8fe43e96f7eb0b98 Mon Sep 17 00:00:00 2001 From: Lonnie Ezell Date: Sun, 17 Dec 2017 23:29:34 -0600 Subject: [PATCH] Allow tests to run with the newly enforced baseURL --- tests/_support/_bootstrap.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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