Skip to content

Commit

Permalink
Fixed #7621 - Add support for config_override.test.php Dillon-Brown 0…
Browse files Browse the repository at this point in the history
…4-Sep-19 05:50
  • Loading branch information
Dillon-Brown committed Sep 4, 2019
1 parent 38d2933 commit 1df20b6
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,6 +20,7 @@ install/status.json
/config.php
/config_override.php
/config_si.php
tests/config.test.php
# Connector configuration should also be ignored.
custom/modules/Connectors/connectors/sources/ext/*/*/config.php
# Logs files can safely be ignored.
Expand Down
151 changes: 129 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion lib/Robo/Traits/CliRunnerTrait.php
Expand Up @@ -65,13 +65,27 @@ protected function bootstrap()
* since they have side effects and can make other
* Robo Tasks fail (i.e. failed database connection).
*/

$root = __DIR__ . '/../../../';

require $root . 'config.php';
require $root . 'config_override.php';
require_once $root . 'include/entryPoint.php';

// Load up the config.test.php file. This is used to define configuration values for the test environment.
$testConfig = [];

if (is_file($root . 'tests/config.test.php')) {
require_once $root . 'tests/config.test.php';
}

foreach (array_keys($testConfig) as $key) {
if (isset($sugar_config[$key])) {
$sugar_config[$key] = $testConfig[$key];
} else {
$sugar_config[] = $testConfig[$key];
}
}

$current_language = 'en_us';
$app_list_strings = return_app_list_strings_language($current_language);
$sugar_config['resource_management']['default_limit'] = 999999;
Expand Down
16 changes: 16 additions & 0 deletions tests/bootstrap.php
Expand Up @@ -47,6 +47,22 @@
require_once __DIR__ . '/../include/utils.php';
require_once __DIR__ . '/../include/modules.php';
require_once __DIR__ . '/../include/entryPoint.php';

// Load up the config.test.php file. This is used to define configuration values for the test environment.
$testConfig = [];

if (is_file(__DIR__ . '/../tests/config.test.php')) {
require_once __DIR__ . '/../tests/config.test.php';
}

foreach (array_keys($testConfig) as $key) {
if (isset($sugar_config[$key])) {
$sugar_config[$key] = $testConfig[$key];
} else {
$sugar_config[] = $testConfig[$key];
}
}

//Oddly entry point loads app_strings but not app_list_strings, manually do this here.
$GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);

Expand Down

0 comments on commit 1df20b6

Please sign in to comment.