gzip,deflate [HTTP_ACCEPT_CHARSET] => ISO-8859-1,utf-8;q=0.7,*;q=0.7 DOCUMENT_ROOT] => /var/www/ [SCRIPT_FILENAME] => /var/www/tests/index.php */ // Set no user and trick a bit to circumvent errors $user = new user(); $user->lang = true; $user->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : ''; $user->referer = (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : ''; $user->forwarded_for = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; $user->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $user->page = session::extract_current_page($phpbb_root_path); } protected function tearDown() { global $user; $user = NULL; } public static function main() { PHPUnit_TextUI_TestRunner::run(self::suite()); } public static function suite() { // I bet there is a better method calling this... :) $suite = new phpbb_security_all_tests('phpBB Security Fixes'); $suite->addTestSuite('phpbb_security_extract_current_page_test'); $suite->addTestSuite('phpbb_security_redirect_test'); return $suite; } } if (PHPUnit_MAIN_METHOD == 'phpbb_security_all_tests::main') { phpbb_security_all_tests::main(); }