Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.257
diff -u -r1.257 search.module
--- modules/search/search.module 14 May 2008 15:07:25 -0000 1.257
+++ modules/search/search.module 23 May 2008 20:35:46 -0000
@@ -105,8 +105,8 @@
case 'search#noresults':
return t('
- Check if your spelling is correct.
-- Remove quotes around phrases to match each word individually: "blue smurf" will match less than blue smurf.
-- Consider loosening your query with OR: blue smurf will match less than blue OR smurf.
+- Remove quotes around phrases to search for each word individually. bike shed will show more results than "bike shed".
+- Consider loosening your query with OR. bike OR shed will show more results than bike shed.
');
}
}
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.2
diff -u -r1.2 search.test
--- modules/search/search.test 14 May 2008 11:10:52 -0000 1.2
+++ modules/search/search.test 23 May 2008 20:35:46 -0000
@@ -161,6 +161,41 @@
}
}
+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 show more results than bike shed.'), t('Help text is displayed when search returns no results.'));
+ }
+}
+
class SearchRankingTestCase extends DrupalWebTestCase {
/**
* Implementation of getInfo().