From 1094a2b577b79c7c456ce34d42fb5ce345297a41 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Fri, 8 Nov 2013 18:35:49 +0530 Subject: [PATCH] [ticket/11040] Add test cases for searching subject and post content together PHPBB3-11040 --- tests/functional/search/base.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/functional/search/base.php b/tests/functional/search/base.php index 28327da914..cec06e6a5c 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 Subject', 'This is a test topic posted by the 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(); @@ -55,7 +57,8 @@ abstract class phpbb_functional_search_base extends phpbb_functional_test_case } $this->logout(); - $this->assert_search_found('phpbb3+installation'); + $this->assert_search_found('phpbb3+installation', 1, 3); + $this->assert_search_found('subject+framework', 1, 2); $this->assert_search_not_found('loremipsumdedo'); $this->login();