1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge remote-tracking branch 'Fyorl/ticket/10939' into develop

* Fyorl/ticket/10939:
  [ticket/10939] Added documentation for phpbb_request::file
  [ticket/10939] Added tests for phpbb_request::file
  [ticket/10939] Modified the default return for $request->file
  [ticket/10939] Modified fileupload tests to deal with new behaviour
  [ticket/10939] Modified mock request class to handle deactivated $_FILES
  [ticket/10939] Modified acp_groups.php to not use $_FILES
  [ticket/10939] Modified ucp_groups.php to not use $_FILES
  [ticket/10939] Modified functions_user.php to not use $_FILES
  [ticket/10939] Modified message_parser.php to not use $_FILES
  [ticket/10939] Modified functions_upload to not use $_FILES
  [ticket/10939] Modified request test slightly to include $_FILES
  [ticket/10939] Added $_FILES handling to phpbb_request
This commit is contained in:
Andreas Fischer
2012-11-10 23:49:29 +01:00
10 changed files with 94 additions and 32 deletions

View File

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