From b7d55b8ff882f702d02c152cdd6e2206c0b74c12 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Wed, 3 Jul 2013 23:25:19 +0530 Subject: [PATCH] [ticket/11608] pass keywords to search_found and search_not_found test PHPBB3-11608 --- tests/functional/search_test.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/functional/search_test.php b/tests/functional/search_test.php index ec5f9de64b..4ed49424b6 100644 --- a/tests/functional/search_test.php +++ b/tests/functional/search_test.php @@ -13,17 +13,19 @@ abstract class phpbb_functional_search_test extends phpbb_functional_test_case { - protected function search_found() + protected function search_found($keywords) { - $crawler = self::request('GET', 'search.php?keywords=phpbb3+installation'); + $crawler = self::request('GET', 'search.php?keywords=' . $keywords); $this->assertEquals(1, $crawler->filter('.postbody')->count()); $this->assertEquals(3, $crawler->filter('.posthilit')->count()); } - protected function search_not_found() + protected function search_not_found($keywords) { - $crawler = self::request('GET', 'search.php?keywords=loremipsumdedo'); + $crawler = self::request('GET', 'search.php?keywords=' . $keywords); $this->assertEquals(0, $crawler->filter('.postbody')->count()); + $split_keywords_string = str_replace(array('+', '-'), ' ', $keywords); + $this->assertEquals($split_keywords_string, $crawler->filter('#keywords')->attr('value')); } public function test_search_backend() @@ -48,7 +50,7 @@ abstract class phpbb_functional_search_test extends phpbb_functional_test_case try { $crawler->filter('.errorbox')->text(); - self::markTestSkipped("Search backend is not supported/running"); + $this->markTestSkipped("Search backend is not supported/running"); } catch (InvalidArgumentException $e) {} @@ -56,8 +58,8 @@ abstract class phpbb_functional_search_test extends phpbb_functional_test_case } $this->logout(); - $this->search_found(); - $this->search_not_found(); + $this->search_found('phpbb3+installation'); + $this->search_not_found('loremipsumdedo'); $this->login(); $this->admin_login();