summaryrefslogtreecommitdiff
path: root/modules/search/search.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/search/search.test')
-rw-r--r--modules/search/search.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/search/search.test b/modules/search/search.test
index 5ee5870d4..913d19891 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -666,6 +666,24 @@ class SearchBlockTestCase extends DrupalWebTestCase {
url('search/node/', array('absolute' => TRUE)),
'Redirected to correct url.'
);
+
+ // Test that after entering a too-short keyword in the form, you can then
+ // search again with a longer keyword. First test using the block form.
+ $terms = array('search_block_form' => 'a');
+ $this->drupalPost('node', $terms, t('Search'));
+ $this->assertText('You must include at least one positive keyword with 3 characters or more');
+ $terms = array('search_block_form' => 'foo');
+ $this->drupalPost(NULL, $terms, t('Search'));
+ $this->assertNoText('You must include at least one positive keyword with 3 characters or more');
+ $this->assertText('Your search yielded no results');
+
+ // Same test again, using the search page form for the second search this time.
+ $terms = array('search_block_form' => 'a');
+ $this->drupalPost('node', $terms, t('Search'));
+ $terms = array('keys' => 'foo');
+ $this->drupalPost(NULL, $terms, t('Search'));
+ $this->assertNoText('You must include at least one positive keyword with 3 characters or more');
+ $this->assertText('Your search yielded no results');
}
}