Update search index and search for comment.
function assertCommentAccess($assume_access, $message) {
// 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
->drupalPost('', $edit, t('Search'));
if ($assume_access) {
$expected_node_result = $this
->assertText($this->node
->label());
$expected_comment_result = $this
->assertText($this->comment_subject);
}
else {
$expected_node_result = $this
->assertNoText($this->node
->label());
$expected_comment_result = $this
->assertNoText($this->comment_subject);
}
$this
->assertTrue($expected_node_result && $expected_comment_result, $message);
}