function SearchNodeAccessTest::testPhraseSearchPunctuation

Tests that search returns results with punctuation in the search phrase.

File

drupal/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php, line 44
Definition of Drupal\search\Tests\SearchNodeAccessTest.

Class

SearchNodeAccessTest
Tests node search with node access control.

Namespace

Drupal\search\Tests

Code

function testPhraseSearchPunctuation() {
  $node = $this
    ->drupalCreateNode(array(
    'body' => array(
      array(
        'value' => "The bunny's ears were fluffy.",
      ),
    ),
  ));

  // 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
    ->label());
}