1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

Merge remote-tracking branch 'phpbb/develop' into feature/softdelete-1-permission

* phpbb/develop: (704 commits)
  [ticket/11630] Improvements to the PHP lint pre-commit hook
  [feature/auth-refactor] Move auth providers to separate directory
  [ticket/11619] Use HTTP/1.0 because of lack of chunked-encoding handling.
  [ticket/11619] Some tests for get_remote_file().
  [ticket/11617] Remove spaces and tabs from empty lines
  [ticket/11617] Missing U_ACTION in acp_captcha.php
  [feature/auth-refactor] Fix code style issue
  [feature/auth-refactor] Fix comment grammar
  [feature/auth-refactor] Fix the actual cause of test failures
  [ticket/10838] Fix URL for wiki and remove irrelevant line
  [ticket/10838] Remove php 5.4 and builtin server references
  [ticket/10838] Fix missing data
  [ticket/10838] separate database used mentioned in unit tests
  [ticket/11585] Make $auth_admin class property
  [feature/auth-refactor] A possible fix for the functional test failures
  [ticket/11566] Subsilver template error displayed after table headers
  [ticket/11566] Remove extra pair of brackets from conditional statement
  [ticket/11566] Check that guest doesn't have reporting permission by default
  [ticket/11566] Add captcha to report post template in subsilver
  [ticket/11566] Use the new constant CONFIRM_REPORT for captcha init
  ...

Conflicts:
	phpBB/docs/sphinx.sample.conf
	phpBB/feed.php
	phpBB/styles/prosilver/template/search_results.html
	phpBB/styles/prosilver/template/viewforum_body.html
This commit is contained in:
Joas Schilling
2013-07-11 11:41:48 +02:00
414 changed files with 15938 additions and 6165 deletions

View File

@@ -53,6 +53,21 @@ class phpbb_mock_cache implements phpbb_cache_driver_interface
);
}
/**
* Obtain disallowed usernames. Input data via standard put method.
*/
public function obtain_disallowed_usernames()
{
if (($usernames = $this->get('_disallowed_usernames')) !== false)
{
return $usernames;
}
else
{
return array();
}
}
public function checkVar(PHPUnit_Framework_Assert $test, $var_name, $data)
{
$test->assertTrue(isset($this->data[$var_name]));

View File

@@ -12,7 +12,8 @@ class phpbb_mock_extension_manager extends phpbb_extension_manager
public function __construct($phpbb_root_path, $extensions = array())
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = '.php';
$this->php_ext = 'php';
$this->extensions = $extensions;
$this->filesystem = new phpbb_filesystem();
}
}

View File

@@ -30,4 +30,9 @@ class phpbb_mock_lang implements ArrayAccess
public function offsetUnset($offset)
{
}
public function lang()
{
return implode(' ', func_get_args());
}
}

View File

@@ -0,0 +1,21 @@
<?php
/**
*
* @package testing
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
class phpbb_mock_metadata_manager extends phpbb_extension_metadata_manager
{
public function set_metadata($metadata)
{
$this->metadata = $metadata;
}
public function merge_metadata($metadata)
{
$this->metadata = array_merge($this->metadata, $metadata);
}
}

View File

@@ -1,69 +0,0 @@
<?php
/**
*
* @package notifications
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Notifications service class
* @package notifications
*/
class phpbb_mock_notifications_notification_manager extends phpbb_notification_manager
{
public function set_var($name, $value)
{
$this->$name = $value;
}
// Extra dependencies for get_*_class functions
protected $auth = null;
protected $cache = null;
protected $config = null;
public function setDependencies($auth, $cache, $config)
{
$this->auth = $auth;
$this->cache = $cache;
$this->config = $config;
}
/**
* Helper to get the notifications item type class and set it up
*/
public function get_item_type_class($item_type, $data = array())
{
$item_type = 'phpbb_notification_type_' . $item_type;
$item = new $item_type($this->user_loader, $this->db, $this->cache, $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
$item->set_notification_manager($this);
$item->set_initial_data($data);
return $item;
}
/**
* Helper to get the notifications method class and set it up
*/
public function get_method_class($method_name)
{
$method_name = 'phpbb_notification_method_' . $method_name;
$method = new $method_name($this->user_loader, $this->db, $this->cache, $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
$method->set_notification_manager($this);
return $method;
}
}

View File

@@ -33,4 +33,17 @@ class phpbb_mock_user
{
$this->options[$item] = $value;
}
public function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false)
{
$banned_users = $this->optionget('banned_users');
foreach ($banned_users as $banned)
{
if ($banned == $user_id || $banned == $user_ips || $banned == $user_email)
{
return true;
}
}
return false;
}
}