From 7804e634d610b03dc5d318143c5bdcfe1b118bf0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 26 May 2008 17:22:59 +0000 Subject: - Patch #242048 by macgirvin, Freso, Senpai, flobruit, catch, robertDouglass, Garrett Albright, et al: change 'blue smurf' to 'bike shed' ;-) --- modules/search/search.module | 4 ++-- modules/search/search.test | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/search/search.module b/modules/search/search.module index 484bfadb9..b03003b0c 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -105,8 +105,8 @@ function search_help($path, $arg) { case 'search#noresults': return t(''); } } diff --git a/modules/search/search.test b/modules/search/search.test index 92d09c1f8..dcaef0a12 100644 --- a/modules/search/search.test +++ b/modules/search/search.test @@ -161,6 +161,41 @@ class SearchMatchTestCase extends DrupalWebTestCase { } } +class SearchBikeShed extends DrupalWebTestCase { + protected $searching_user; + /** + * Implementation of getInfo(). + */ + function getInfo() { + return array( + 'name' => t('Bike shed'), + 'description' => t('Tests the bike shed text on the no results page.'), + 'group' => t('Search') + ); + } + + /** + * Implementation of setUp(). + */ + function setUp() { + parent::setUp('search'); + + // Create user. + $this->searching_user = $this->drupalCreateUser(array('search content')); + } + + function testFailedSearch() { + $this->drupalLogin($this->searching_user); + $this->drupalGet('search/node'); + $this->assertText(t('Enter your keywords')); + + $edit = array(); + $edit['keys'] = 'bike shed ' . $this->randomName(); + $this->drupalPost('search/node', $edit, t('Search')); + $this->assertText(t('Consider loosening your query with OR. bike OR shed will often show more results than bike shed.'), t('Help text is displayed when search returns no results.')); + } +} + class SearchRankingTestCase extends DrupalWebTestCase { /** * Implementation of getInfo(). -- cgit v1.2.3