summaryrefslogtreecommitdiff
path: root/modules/search
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-08-23 23:47:52 +0100
committerwebchick <webchick@24967.no-reply.drupal.org>2011-08-23 23:47:52 +0100
commit43bd387c4033720c87495e5bcc1869c24439a6a7 (patch)
tree8dcaef32e3e3d7870a044dfcbf383a91e95ac659 /modules/search
parent23c31ac7141f3d8be913705ae269b22187623d98 (diff)
downloadbrdo-43bd387c4033720c87495e5bcc1869c24439a6a7.tar.gz
brdo-43bd387c4033720c87495e5bcc1869c24439a6a7.tar.bz2
Issue #1202416 by xjm, joelstein: Tests for search working with node access turned on.
Diffstat (limited to 'modules/search')
-rw-r--r--modules/search/search.test43
1 files changed, 43 insertions, 0 deletions
diff --git a/modules/search/search.test b/modules/search/search.test
index 4d3713311..488a45e80 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -1947,3 +1947,46 @@ class SearchLanguageTestCase extends DrupalWebTestCase {
$this->assertNoText(t('Languages'), t('No languages to choose from.'));
}
}
+
+/**
+ * Tests node search with node access control.
+ */
+class SearchNodeAccessTest extends DrupalWebTestCase {
+ public $test_user;
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'Search and node access',
+ 'description' => 'Tests search functionality with node access control.',
+ 'group' => 'Search',
+ );
+ }
+
+ function setUp() {
+ parent::setUp('search', 'node_access_test');
+ node_access_rebuild();
+
+ // Create a test user and log in.
+ $this->test_user = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search'));
+ $this->drupalLogin($this->test_user);
+ }
+
+ /**
+ * Tests that search returns results with punctuation in the search phrase.
+ */
+ function testPhraseSearchPunctuation() {
+ $node = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => "The bunny's ears were furry.")))));
+
+ // Update the search index.
+ module_invoke_all('update_index');
+ search_update_totals();
+
+ // Refresh variables after the treatment.
+ $this->refreshVariables();
+
+ // Submit a phrase wrapped in double quotes to include the punctuation.
+ $edit = array('keys' => '"bunny\'s"');
+ $this->drupalPost('search/node', $edit, t('Search'));
+ $this->assertText($node->title);
+ }
+}