Skip to content
Snippets Groups Projects
Commit 14dd1564 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #384 from splitbrain/lang_in_tests

Fix missing values in unittest harness
parents 8a2fc4c5 4e2ac2e4
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,13 @@ $default_server_vars = array(
'REQUEST_TIME' => time(),
);
// fixup for $_SERVER when run from CLI,
// some values should be mocked for use by inc/init.php which is called here
// [ $_SERVER is also mocked in TestRequest::execute() ]
if (php_sapi_name() == 'cli') {
$_SERVER = array_merge($default_server_vars, $_SERVER);
}
// create temp directories
mkdir(TMP_DIR);
......
......@@ -267,10 +267,10 @@ function init_lang($langCode) {
$lang = array();
//load the language files
require_once(DOKU_INC.'inc/lang/en/lang.php');
require(DOKU_INC.'inc/lang/en/lang.php');
if ($langCode && $langCode != 'en') {
if (file_exists(DOKU_INC."inc/lang/$langCode/lang.php")) {
require_once(DOKU_INC."inc/lang/$langCode/lang.php");
require(DOKU_INC."inc/lang/$langCode/lang.php");
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment