mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[ticket/17535] Convert config files, make data providers static
PHPBB-17535
This commit is contained in:
@@ -17,7 +17,7 @@ abstract class phpbb_search_common_test_case extends phpbb_search_test_case
|
||||
{
|
||||
protected $search;
|
||||
|
||||
public function keywords()
|
||||
public static function keywords()
|
||||
{
|
||||
return array(
|
||||
// keywords
|
||||
|
@@ -34,8 +34,10 @@ class phpbb_search_mysql_test extends phpbb_search_common_test_case
|
||||
$user = $this->createMock('\phpbb\user');
|
||||
|
||||
// set config values
|
||||
$config['fulltext_mysql_min_word_len'] = 4;
|
||||
$config['fulltext_mysql_max_word_len'] = 254;
|
||||
$config = new \phpbb\config\config([
|
||||
'fulltext_mysql_min_word_len' => 4,
|
||||
'fulltext_mysql_max_word_len' => 254,
|
||||
]);
|
||||
|
||||
$this->db = $this->new_dbal();
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
|
@@ -43,13 +43,15 @@ class phpbb_search_native_test extends phpbb_search_test_case
|
||||
$this->db_tools = $tools_factory->get($this->new_doctrine_dbal());
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$class = self::get_search_wrapper('\phpbb\search\backend\fulltext_native');
|
||||
$config['fulltext_native_min_chars'] = 2;
|
||||
$config['fulltext_native_max_chars'] = 14;
|
||||
$config['max_num_search_keywords'] = 10;
|
||||
$config = new \phpbb\config\config([
|
||||
'fulltext_native_min_chars' => 2,
|
||||
'fulltext_native_max_chars' => 14,
|
||||
'max_num_search_keywords' => 10,
|
||||
]);
|
||||
$this->search = new $class($config, $this->db, $this->db_tools, $phpbb_dispatcher, $language, $user, SEARCH_RESULTS_TABLE, SEARCH_WORDLIST_TABLE, SEARCH_WORDMATCH_TABLE, $phpbb_root_path, $phpEx);
|
||||
}
|
||||
|
||||
public function keywords()
|
||||
public static function keywords()
|
||||
{
|
||||
return array(
|
||||
// keywords
|
||||
@@ -268,7 +270,7 @@ class phpbb_search_native_test extends phpbb_search_test_case
|
||||
$this->assert_array_content_equals($common, $this->search->get_common_words());
|
||||
}
|
||||
|
||||
public function data_split_keywords_max(): array
|
||||
public static function data_split_keywords_max(): array
|
||||
{
|
||||
return [
|
||||
'character count within limits separated by more spaces' => [
|
||||
|
@@ -34,8 +34,10 @@ class phpbb_search_postgres_test extends phpbb_search_common_test_case
|
||||
$user = $this->createMock('\phpbb\user');
|
||||
|
||||
// set config values
|
||||
$config['fulltext_postgres_min_word_len'] = 4;
|
||||
$config['fulltext_postgres_max_word_len'] = 254;
|
||||
$config = new \phpbb\config\config([
|
||||
'fulltext_postgres_min_word_len' => 4,
|
||||
'fulltext_postgres_max_word_len' => 254,
|
||||
]);
|
||||
|
||||
$this->db = $this->new_dbal();
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
|
Reference in New Issue
Block a user