summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/search/search.module4
-rw-r--r--modules/search/search.test35
2 files changed, 37 insertions, 2 deletions
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('<ul>
<li>Check if your spelling is correct.</li>
-<li>Remove quotes around phrases to match each word individually: <em>"blue smurf"</em> will match less than <em>blue smurf</em>.</li>
-<li>Consider loosening your query with <em>OR</em>: <em>blue smurf</em> will match less than <em>blue OR smurf</em>.</li>
+<li>Remove quotes around phrases to search for each word individually. <em>bike shed</em> will often show more results than <em>&quot;bike shed&quot;</em>.</li>
+<li>Consider loosening your query with <em>OR</em>. <em>bike OR shed</em> will often show more results than <em>bike shed</em>.</li>
</ul>');
}
}
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().