summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-10-12 02:23:36 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-10-12 02:23:36 -0400
commite67dfa572cde8575162c03594c168183efda0849 (patch)
treef5e987d2c04996ac568f185ac0da5486cb6c0044 /modules
parentc515c14dadab747b7fb02af04723be2435dff6b8 (diff)
downloadbrdo-e67dfa572cde8575162c03594c168183efda0849.tar.gz
brdo-e67dfa572cde8575162c03594c168183efda0849.tar.bz2
Issue #2060553 by jhodgdon, sivaji@knackforge.com, manningpete: Test that searching for HTML entities works as expected
Diffstat (limited to 'modules')
-rw-r--r--modules/search/search.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/search/search.test b/modules/search/search.test
index 5f16db3f8..5ee5870d4 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -2029,10 +2029,11 @@ class SearchNodeAccessTest extends DrupalWebTestCase {
}
/**
- * Tests that search returns results with punctuation in the search phrase.
+ * Tests that search works with punctuation and HTML entities.
*/
function testPhraseSearchPunctuation() {
$node = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => "The bunny's ears were fuzzy.")))));
+ $node2 = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => 'Dignissim Aliquam &amp; Quieligo meus natu quae quia te. Damnum&copy; erat&mdash; neo pneum. Facilisi feugiat ibidem ratis.')))));
// Update the search index.
module_invoke_all('update_index');
@@ -2045,6 +2046,17 @@ class SearchNodeAccessTest extends DrupalWebTestCase {
$edit = array('keys' => '"bunny\'s"');
$this->drupalPost('search/node', $edit, t('Search'));
$this->assertText($node->title);
+
+ // Search for "&" and verify entities are not broken up in the output.
+ $edit = array('keys' => '&');
+ $this->drupalPost('search/node', $edit, t('Search'));
+ $this->assertNoRaw('<strong>&</strong>amp;');
+ $this->assertText('You must include at least one positive keyword');
+
+ $edit = array('keys' => '&amp;');
+ $this->drupalPost('search/node', $edit, t('Search'));
+ $this->assertNoRaw('<strong>&</strong>amp;');
+ $this->assertText('You must include at least one positive keyword');
}
}