diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2013-10-18 12:05:50 +0100 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2013-10-18 12:05:50 +0100 |
commit | 4e2ac2e47ffdfffadfa5674d55f6f96c5e1cae77 (patch) | |
tree | 8db1cfb4f5865d8829e2ed9bdc064b47e0c52fb4 /_test | |
parent | 1d82c8d343dd1d6c413eb117d8658b78c367df91 (diff) | |
download | rpg-4e2ac2e47ffdfffadfa5674d55f6f96c5e1cae77.tar.gz rpg-4e2ac2e47ffdfffadfa5674d55f6f96c5e1cae77.tar.bz2 |
add missing $_SERVER values for init.php when called from cli
Diffstat (limited to '_test')
-rw-r--r-- | _test/bootstrap.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/_test/bootstrap.php b/_test/bootstrap.php index 732fef9ed..3f59db515 100644 --- a/_test/bootstrap.php +++ b/_test/bootstrap.php @@ -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); |