diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-03-14 10:13:42 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-03-14 10:13:42 +0100 |
commit | 5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d (patch) | |
tree | 3c9fe1936aa216b0fe9d22299963aa9c7e116b5d /tests/functional | |
parent | 3c6a17ae6bc494d68f7230c932e9ac036207ce77 (diff) | |
parent | 6918921d53da75bf1b77dcbffff10e8dc574fbdb (diff) | |
download | forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar.gz forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar.bz2 forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.tar.xz forums-5f8f1f04fdcc30b0d2c3173661eb8eefbc371a4d.zip |
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
Diffstat (limited to 'tests/functional')
-rw-r--r-- | tests/functional/search/base.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php index 28327da914..0bd9bf01ab 100644 --- a/tests/functional/search/base.php +++ b/tests/functional/search/base.php @@ -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() |