Overwrite backupGlobals + base_url generation in testing mode

This commit is contained in:
jekkos-t520
2020-02-28 23:49:24 +01:00
committed by jekkos
parent bc4a5570a5
commit 2110692664
2 changed files with 4 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN composer install -d/app
RUN php /app/vendor/kenjis/ci-phpunit-test/install.php -a /app/application -p /app/vendor/codeigniter/framework
RUN sed -i 's/backupGlobals="true"/backupGlobals="false"/g' /app/application/tests/phpunit.xml
WORKDIR /app/application/tests

View File

@@ -65,7 +65,9 @@ $config['db_log_enabled'] = FALSE;
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = '';
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true')) ? 'https' : 'http';
$config['base_url'] .= '://' . (ENVIRONMENT == "testing") ? 'localhost' : $_SERVER['HTTP_HOST'] ;
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
/*
|--------------------------------------------------------------------------