1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-23 03:19:01 +01:00

[ticket/11040] Add test cases for searching subject and post content together

PHPBB3-11040
This commit is contained in:
Dhruv 2013-11-08 18:35:49 +05:30
parent 101ceed80c
commit 1094a2b577

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 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();