From 07c259f4b1036ab299c3293c3961125c19907017 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 6 Jul 2013 14:38:42 +0530 Subject: [PATCH] [ticket/11608] rename search_found and not_found method Rename search_found and search_not_found to assert_search_found and assert_search_not_found. Count .errorbox incase the search backend is not supported and skip tests PHPBB3-11608 --- tests/functional/search_test.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/functional/search_test.php b/tests/functional/search_test.php index 4ed49424b6..2090e73a4c 100644 --- a/tests/functional/search_test.php +++ b/tests/functional/search_test.php @@ -12,15 +12,14 @@ */ abstract class phpbb_functional_search_test extends phpbb_functional_test_case { - - protected function search_found($keywords) + protected function assert_search_found($keywords) { $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($keywords) + protected function assert_search_not_found($keywords) { $crawler = self::request('GET', 'search.php?keywords=' . $keywords); $this->assertEquals(0, $crawler->filter('.postbody')->count()); @@ -47,19 +46,18 @@ abstract class phpbb_functional_search_test extends phpbb_functional_test_case $values = $form->getValues(); $crawler = self::submit($form); - try + // check if search backend is not supported + if ($crawler->filter('.errorbox')->count() > 0); { - $crawler->filter('.errorbox')->text(); $this->markTestSkipped("Search backend is not supported/running"); } - catch (InvalidArgumentException $e) {} $this->create_search_index(); } $this->logout(); - $this->search_found('phpbb3+installation'); - $this->search_not_found('loremipsumdedo'); + $this->assert_search_found('phpbb3+installation'); + $this->assert_search_not_found('loremipsumdedo'); $this->login(); $this->admin_login();