aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-11-08 18:35:49 +0530
committerDhruv <dhruv.goel92@gmail.com>2014-03-12 11:02:01 +0530
commit1094a2b577b79c7c456ce34d42fb5ce345297a41 (patch)
treef92ecf7ad271da01ddebe5c8e0df1ff3306fc616 /tests
parent101ceed80c4ba3b24aaf92d1e72529c086237888 (diff)
downloadforums-1094a2b577b79c7c456ce34d42fb5ce345297a41.tar
forums-1094a2b577b79c7c456ce34d42fb5ce345297a41.tar.gz
forums-1094a2b577b79c7c456ce34d42fb5ce345297a41.tar.bz2
forums-1094a2b577b79c7c456ce34d42fb5ce345297a41.tar.xz
forums-1094a2b577b79c7c456ce34d42fb5ce345297a41.zip
[ticket/11040] Add test cases for searching subject and post content together
PHPBB3-11040
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/search/base.php11
1 files 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();