Use a more realistic server environment in unit tests

This commit is contained in:
Kijin Sung 2016-03-16 09:13:31 +09:00
parent b088348be2
commit ca7a7b64ea
9 changed files with 81 additions and 98 deletions

View file

@ -1,6 +1,17 @@
<?php
// This is global bootstrap for autoloading
require dirname(__DIR__) . '/common/autoload.php';
// Set some superglobal variables for unit tests.
$_SERVER['HTTPS'] = 'on';
$_SERVER['HTTP_HOST'] = 'www.rhymix.org';
$_SERVER['SERVER_NAME'] = 'www.rhymix.org';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['DOCUMENT_ROOT'] = dirname(dirname(__DIR__));
$_SERVER['SCRIPT_FILENAME'] = dirname(__DIR__) . '/index.php';
$_SERVER['SCRIPT_NAME'] = '/rhymix/index.php';
$_SERVER['REQUEST_URI'] = '/rhymix/index.php';
// Include the autoloader.
require_once dirname(__DIR__) . '/common/autoload.php';
function _debug() {
$args = func_get_args();