1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[ticket/15540] Fix tests

PHPBB3-15540
This commit is contained in:
rubencm
2020-08-15 13:05:54 +00:00
parent ee9ea98a01
commit 1bc9cbefb2
17 changed files with 62 additions and 146 deletions

View File

@@ -4,7 +4,6 @@ services:
search.fulltext.native:
class: phpbb\search\backend\fulltext_native
arguments:
- '@auth'
- '@config'
- '@dbal.conn'
- '@dispatcher'
@@ -17,7 +16,6 @@ services:
search.fulltext.mysql:
class: phpbb\search\backend\fulltext_mysql
arguments:
- '@auth'
- '@config'
- '@dbal.conn'
- '@dispatcher'
@@ -30,7 +28,6 @@ services:
search.fulltext.postgres:
class: phpbb\search\backend\fulltext_postgres
arguments:
- '@auth'
- '@config'
- '@dbal.conn'
- '@dispatcher'

View File

@@ -1330,7 +1330,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
*/
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;
global $auth, $user, $db, $template, $config, $phpbb_container;
global $phpEx, $phpbb_root_path, $phpbb_log, $request, $phpbb_dispatcher;
if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))

View File

@@ -428,7 +428,7 @@ function mcp_topic_view($id, $mode, $action)
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config, $phpbb_log, $request;
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config, $phpbb_log, $request, $phpbb_container;
$post_id_list = $request->variable('post_id_list', array(0));
$forum_id = $request->variable('forum_id', 0);

View File

@@ -78,16 +78,14 @@ class fulltext_mysql extends base implements search_backend_interface
* Constructor
* Creates a new \phpbb\search\backend\fulltext_mysql, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
* @param string $phpbb_root_path Relative path to phpBB root
* @param string $phpEx PHP file extension
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\config\config $config Config object
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param \phpbb\user $user User object
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param string $phpbb_root_path Relative path to phpBB root
* @param string $phpEx PHP file extension
*/
public function __construct($auth, $config, $db, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx)
public function __construct($config, $db, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx)
{
$this->config = $config;
$this->db = $db;

View File

@@ -13,6 +13,11 @@
namespace phpbb\search\backend;
use phpbb\config\config;
use phpbb\db\driver\driver_interface;
use phpbb\event\dispatcher_interface;
use phpbb\user;
/**
* phpBB's own db driven fulltext search, version 2
*/
@@ -83,41 +88,39 @@ class fulltext_native extends base implements search_backend_interface
/**
* Config object
* @var \phpbb\config\config
* @var config
*/
protected $config;
/**
* Database connection
* @var \phpbb\db\driver\driver_interface
* @var driver_interface
*/
protected $db;
/**
* phpBB event dispatcher object
* @var \phpbb\event\dispatcher_interface
* @var dispatcher_interface
*/
protected $phpbb_dispatcher;
/**
* User object
* @var \phpbb\user
* @var user
*/
protected $user;
/**
* Initialises the fulltext_native search backend with min/max word length
*
* @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure
* @param string $phpbb_root_path phpBB root path
* @param string $phpEx PHP file extension
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\config\config $config Config object
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\user $user User object
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
*/
public function __construct($auth, $config, $db, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx)
* Initialises the fulltext_native search backend with min/max word length
*
* @param config $config Config object
* @param driver_interface $db Database object
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param user $user User object
* @param string $phpbb_root_path phpBB root path
* @param string $phpEx PHP file extension
*/
public function __construct($config, $db, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx)
{
$this->config = $config;
$this->db = $db;

View File

@@ -13,6 +13,11 @@
namespace phpbb\search\backend;
use phpbb\config\config;
use phpbb\db\driver\driver_interface;
use phpbb\event\dispatcher_interface;
use phpbb\user;
/**
* Fulltext search for PostgreSQL
*/
@@ -45,7 +50,7 @@ class fulltext_postgres extends base implements search_backend_interface
/**
* Config object
* @var \phpbb\config\config
* @var config
*/
protected $config;
@@ -57,13 +62,13 @@ class fulltext_postgres extends base implements search_backend_interface
/**
* phpBB event dispatcher object
* @var \phpbb\event\dispatcher_interface
* @var dispatcher_interface
*/
protected $phpbb_dispatcher;
/**
* User object
* @var \phpbb\user
* @var user
*/
protected $user;
@@ -91,16 +96,14 @@ class fulltext_postgres extends base implements search_backend_interface
* Constructor
* Creates a new \phpbb\search\backend\fulltext_postgres, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
* @param config $config Config object
* @param driver_interface $db Database object
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param user $user User object
* @param string $phpbb_root_path Relative path to phpBB root
* @param string $phpEx PHP file extension
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\config\config $config Config object
* @param \phpbb\db\driver\driver_interface Database object
* @param \phpbb\user $user User object
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
*/
public function __construct($auth, $config, $db, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx)
public function __construct($config, $db, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx)
{
$this->config = $config;
$this->db = $db;

View File

@@ -13,6 +13,11 @@
namespace phpbb\search\backend;
use phpbb\auth\auth;
use phpbb\config\config;
use phpbb\event\dispatcher_interface;
use phpbb\user;
define('SPHINX_MAX_MATCHES', 20000);
define('SPHINX_CONNECT_RETRIES', 3);
define('SPHINX_CONNECT_WAIT_TIME', 300);
@@ -67,13 +72,13 @@ class fulltext_sphinx implements search_backend_interface
/**
* Auth object
* @var \phpbb\auth\auth
* @var auth
*/
protected $auth;
/**
* Config object
* @var \phpbb\config\config
* @var config
*/
protected $config;
@@ -97,13 +102,13 @@ class fulltext_sphinx implements search_backend_interface
/**
* phpBB event dispatcher object
* @var \phpbb\event\dispatcher_interface
* @var dispatcher_interface
*/
protected $phpbb_dispatcher;
/**
* User object
* @var \phpbb\user
* @var user
*/
protected $user;
@@ -124,14 +129,14 @@ class fulltext_sphinx implements search_backend_interface
* Constructor
* Creates a new \phpbb\search\backend\fulltext_postgres, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
* @param auth $auth Auth object
* @param config $config Config object
* @param $db
* @param dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param user $user User object
* @param string $phpbb_root_path Relative path to phpBB root
* @param string $phpEx PHP file extension
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\config\config $config Config object
* @param \phpbb\db\driver\driver_interface Database object
* @param \phpbb\user $user User object
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @throws \Exception
*/
public function __construct($auth, $config, $db, $phpbb_dispatcher, $user, $phpbb_root_path, $phpEx)
{