aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFyorl <gaelreth@gmail.com>2012-08-15 15:36:41 +0100
committerFyorl <gaelreth@gmail.com>2012-08-15 15:36:41 +0100
commit348554cc297bf906a0510894986bb60041a5db9a (patch)
tree965e59686206e99abbeebfd4f632e2285ef48826 /tests
parent94ed66c777d22e16ba73d317889707b90f755878 (diff)
downloadforums-348554cc297bf906a0510894986bb60041a5db9a.tar
forums-348554cc297bf906a0510894986bb60041a5db9a.tar.gz
forums-348554cc297bf906a0510894986bb60041a5db9a.tar.bz2
forums-348554cc297bf906a0510894986bb60041a5db9a.tar.xz
forums-348554cc297bf906a0510894986bb60041a5db9a.zip
[ticket/10939] Modified mock request class to handle deactivated $_FILES
PHPBB3-10939
Diffstat (limited to 'tests')
-rw-r--r--tests/mock/request.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/mock/request.php b/tests/mock/request.php
index 946dfdada9..2a272fc03b 100644
--- a/tests/mock/request.php
+++ b/tests/mock/request.php
@@ -11,13 +11,14 @@ class phpbb_mock_request implements phpbb_request_interface
{
protected $data;
- public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false)
+ public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false, $files = array())
{
$this->data[phpbb_request_interface::GET] = $get;
$this->data[phpbb_request_interface::POST] = $post;
$this->data[phpbb_request_interface::COOKIE] = $cookie;
$this->data[phpbb_request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
$this->data[phpbb_request_interface::SERVER] = $server;
+ $this->data[phpbb_request_interface::FILES] = $files;
}
public function overwrite($var_name, $value, $super_global = phpbb_request_interface::REQUEST)
@@ -42,6 +43,12 @@ class phpbb_mock_request implements phpbb_request_interface
return $this->server($var_name, $default);
}
+ public function file($form_name)
+ {
+ $super_global = phpbb_request_interface::FILES;
+ return isset($this->data[$super_global][$form_name]) ? $this->data[$super_global][$form_name] : array();
+ }
+
public function is_set_post($name)
{
return $this->is_set($name, phpbb_request_interface::POST);