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.test36
1 files changed, 35 insertions, 1 deletions
diff --git a/modules/search/search.test b/modules/search/search.test
index df76e4a23..b4c38312c 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -1050,7 +1050,7 @@ class SearchSimplifyTestCase extends DrupalWebTestCase {
/**
- * Test config page.
+ * Tests keywords and conditions.
*/
class SearchKeywordsConditions extends DrupalWebTestCase {
@@ -1523,3 +1523,37 @@ class SearchEmbedForm extends DrupalWebTestCase {
$this->submit_count = $count;
}
}
+
+/**
+ * Tests that hook_search_page runs.
+ */
+class SearchPageOverride extends DrupalWebTestCase {
+ public $search_user;
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'Search page override',
+ 'description' => 'Verify that hook_search_page can override search page display.',
+ 'group' => 'Search',
+ );
+ }
+
+ function setUp() {
+ parent::setUp('search', 'search_extra_type');
+
+ // Login as a user that can create and search content.
+ $this->search_user = $this->drupalCreateUser(array('search content', 'administer search'));
+ $this->drupalLogin($this->search_user);
+
+ // Enable the extra type module for searching.
+ variable_set('search_active_modules', array('node' => 'node', 'user' => 'user', 'search_extra_type' => 'search_extra_type'));
+ menu_rebuild();
+ }
+
+ function testSearchPageHook() {
+ $keys = 'bike shed ' . $this->randomName();
+ $this->drupalGet("search/dummy_path/{$keys}");
+ $this->assertText('Dummy search snippet', 'Dummy search snippet is shown');
+ $this->assertText('Test page text is here', 'Page override is working');
+ }
+}