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

Merge remote-tracking branch 'dhruv/ticket/11040' into develop

* dhruv/ticket/11040:
  [ticket/11040] Topic is deleted if test is skipped
  [ticket/11040] Use unique text for the test post added
  [ticket/11040] Use hard delete in delete_topic
  [ticket/11040] Add migration to drop postgres search indexes
  [ticket/11040] Delete the functional test topic to avoid conflicts
  [ticket/11040] Add methods to delete post and topic in functional tests
  [ticket/11040] Swap post_text and post_subject for post_content index
  [ticket/11040] Add test cases for searching subject and post content together
  [ticket/11040] Remove postgres extra indexes
  [ticket/11040] Add post_content index
  [ticket/11040] Search subject and text together
This commit is contained in:
Joas Schilling
2014-03-14 10:13:42 +01:00
4 changed files with 115 additions and 19 deletions

View File

@@ -12,11 +12,11 @@
*/
abstract class phpbb_functional_search_base extends phpbb_functional_test_case
{
protected function assert_search_found($keywords)
protected function assert_search_found($keywords, $posts_found, $words_highlighted)
{
$crawler = self::request('GET', 'search.php?keywords=' . $keywords);
$this->assertEquals(1, $crawler->filter('.postbody')->count());
$this->assertEquals(3, $crawler->filter('.posthilit')->count());
$this->assertEquals($posts_found, $crawler->filter('.postbody')->count());
$this->assertEquals($words_highlighted, $crawler->filter('.posthilit')->count());
}
protected function assert_search_not_found($keywords)
@@ -32,6 +32,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
$this->login();
$this->admin_login();
$post = $this->create_topic(2, 'Test Topic 1 foosubject', 'This is a test topic posted by the barsearch testing framework.');
$crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=settings&sid=' . $this->sid);
$form = $crawler->selectButton('Submit')->form();
$values = $form->getValues();
@@ -49,18 +51,21 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case
// check if search backend is not supported
if ($crawler->filter('.errorbox')->count() > 0)
{
$this->delete_topic($post['topic_id']);
$this->markTestSkipped("Search backend is not supported/running");
}
$this->create_search_index();
}
$this->logout();
$this->assert_search_found('phpbb3+installation');
$this->assert_search_found('phpbb3+installation', 1, 3);
$this->assert_search_found('foosubject+barsearch', 1, 2);
$this->assert_search_not_found('loremipsumdedo');
$this->login();
$this->admin_login();
$this->delete_search_index();
$this->delete_topic($post['topic_id']);
}
protected function create_search_index()