diff options
Diffstat (limited to 'tests/security/base.php')
-rw-r--r-- | tests/security/base.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/security/base.php b/tests/security/base.php index 8cd24ff145..3ab2d1cfec 100644 --- a/tests/security/base.php +++ b/tests/security/base.php @@ -14,7 +14,7 @@ abstract class phpbb_security_test_base extends phpbb_test_case */ protected function setUp() { - global $user, $phpbb_root_path, $request; + global $user, $phpbb_root_path, $phpEx, $request, $symfony_request, $phpbb_filesystem; // Put this into a global function being run by every test to init a proper user session $server['HTTP_HOST'] = 'localhost'; @@ -37,6 +37,22 @@ abstract class phpbb_security_test_base extends phpbb_test_case */ $request = new phpbb_mock_request(array(), array(), array(), $server); + $symfony_request = $this->getMock("\phpbb\symfony_request", array(), array( + $request, + )); + $symfony_request->expects($this->any()) + ->method('getScriptName') + ->will($this->returnValue($server['SCRIPT_NAME'])); + $symfony_request->expects($this->any()) + ->method('getQueryString') + ->will($this->returnValue($server['QUERY_STRING'])); + $symfony_request->expects($this->any()) + ->method('getBasePath') + ->will($this->returnValue($server['REQUEST_URI'])); + $symfony_request->expects($this->any()) + ->method('getPathInfo') + ->will($this->returnValue('/')); + $phpbb_filesystem = new \phpbb\filesystem($symfony_request, $phpbb_root_path, $phpEx); // Set no user and trick a bit to circumvent errors $user = new \phpbb\user(); |