1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 09:16:55 +02:00

[ticket/11850] Fix extract current page test

PHPBB3-11850
This commit is contained in:
Nathan Guse
2013-09-19 11:49:13 -05:00
parent d85ae0f7bc
commit 2ee22d4615
2 changed files with 47 additions and 11 deletions

View File

@@ -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();