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

[ticket/16976] Fix search results count

PHPBB3-16976
This commit is contained in:
rxu
2022-03-24 20:54:48 +07:00
parent f16929ff9e
commit d44dd404a3
3 changed files with 14 additions and 5 deletions

View File

@@ -88,6 +88,9 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
$this->create_search_index('phpbb\\search\\backend\\fulltext_native');
$post = $this->create_topic(2, 'Test Topic 1 foosubject', 'This is a test topic posted by the barsearch testing framework.');
$topic_multiple_results_count1 = $this->create_topic(2, 'Test Topic for multiple search results', 'This is a test topic posted to test multiple results count.');
$this->create_post(2, $topic_multiple_results_count1['topic_id'], 'Re: Test Topic for multiple search results', 'This is a test post 2 posted to test multiple results count.');
$topic_multiple_results_count2 = $this->create_topic(2, 'Test Topic 2 for multiple search results', 'This is a test topic 2 posted to test multiple results count.');
$this->set_flood_interval(15);
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=settings&sid=' . $this->sid);
@@ -113,6 +116,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// Search backed is not supported because don't appear in the select
$this->delete_topic($post['topic_id']);
$this->delete_topic($topic_by_author['topic_id']);
$this->delete_topic($topic_multiple_results_count1['topic_id']);
$this->delete_topic($topic_multiple_results_count2['topic_id']);
$this->markTestSkipped("Search backend is not supported/running");
}
@@ -140,6 +145,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
$this->assert_search_found('foosubject+barsearch', 1, 2, $sort_key);
$this->assert_search_found('barsearch-testing', 1, 2, $sort_key); // test hyphen ignored
$this->assert_search_found('barsearch+-+testing', 1, 2, $sort_key); // test hyphen wrapped with space ignored
$this->assert_search_found('multiple+results+count', 3, 15, $sort_key); // test multiple results count - posts
$this->assert_search_found_topics('multiple+results+count', 2, $sort_key); // test multiple results count - topics
$this->assert_search_found_topics('phpbb3+installation', 1, $sort_key);
$this->assert_search_found_topics('foosubject+barsearch', 1, $sort_key);
@@ -156,6 +163,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
$this->delete_search_index();
$this->delete_topic($post['topic_id']);
$this->delete_topic($topic_by_author['topic_id']);
$this->delete_topic($topic_multiple_results_count1['topic_id']);
$this->delete_topic($topic_multiple_results_count2['topic_id']);
}
protected function create_search_index($backend = null)