aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-05-27 18:13:06 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-06-01 21:31:04 +0200
commit3508409c89acd53943d7e9d1b32982fd021122f0 (patch)
treeffdb95b6c5c1b7ace4755bc857d0c6f25942eccc /tests/mock
parent5a243af879b42f1323d716f75c981bcfb42b2afe (diff)
downloadforums-3508409c89acd53943d7e9d1b32982fd021122f0.tar
forums-3508409c89acd53943d7e9d1b32982fd021122f0.tar.gz
forums-3508409c89acd53943d7e9d1b32982fd021122f0.tar.bz2
forums-3508409c89acd53943d7e9d1b32982fd021122f0.tar.xz
forums-3508409c89acd53943d7e9d1b32982fd021122f0.zip
[ticket/12352] Add tests for phpBB2 md5 passwords driver
PHPBB3-12352
Diffstat (limited to 'tests/mock')
-rw-r--r--tests/mock/request.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/mock/request.php b/tests/mock/request.php
index 89d5321a25..304fcf0eaf 100644
--- a/tests/mock/request.php
+++ b/tests/mock/request.php
@@ -15,6 +15,8 @@ class phpbb_mock_request implements \phpbb\request\request_interface
{
protected $data;
+ protected $super_globals_disabled = false;
+
public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false, $files = array())
{
$this->data[\phpbb\request\request_interface::GET] = $get;
@@ -23,6 +25,8 @@ class phpbb_mock_request implements \phpbb\request\request_interface
$this->data[\phpbb\request\request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
$this->data[\phpbb\request\request_interface::SERVER] = $server;
$this->data[\phpbb\request\request_interface::FILES] = $files;
+
+ $this->disable_super_globals();
}
public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
@@ -83,6 +87,21 @@ class phpbb_mock_request implements \phpbb\request\request_interface
return $this->data[$super_global];
}
+ public function super_globals_disabled()
+ {
+ return $this->super_globals_disabled;
+ }
+
+ public function disable_super_globals()
+ {
+ $this->super_globals_disabled = true;
+ }
+
+ public function enable_super_globals()
+ {
+ $this->super_globals_disabled = false;
+ }
+
/* custom methods */
public function set_header($header_name, $value)