1
0
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:
rxu
2025-07-16 17:36:45 +07:00
parent d7db296eab
commit 8a99024087
199 changed files with 879 additions and 852 deletions

View File

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

View File

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

View File

@@ -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' => [

View File

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