1 search.test SearchCommentTestCase::assertCommentAccess($message, $assume_access = FALSE)

Update search index and search for comment.

File

core/modules/search/tests/search.test, line 888
Tests for search.module.

Class

SearchCommentTestCase
Test integration searching comments.

Code

function assertCommentAccess($message, $assume_access = FALSE) {
  // Invoke search index update.
  search_touch_node($this->node->nid);
  $this->cronRun();

  // Search for the comment subject.
  $edit = array(
    'search_block_form' => "'" . $this->comment_subject . "'",
  );
  $this->backdropPost('user', $edit, t('Search'));
  $method = $assume_access ? 'assertText' : 'assertNoText';
  $verb = $assume_access ? 'found' : 'not found';
  $this->{$method}($this->node->title, "Node $verb in search results: " . $message);
  $this->{$method}($this->comment_subject, "Comment subject $verb in search results: " . $message);
}