You are here

public function SearchCommentTest::setRolePermissions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/search/tests/src/Functional/SearchCommentTest.php \Drupal\Tests\search\Functional\SearchCommentTest::setRolePermissions()

Set permissions for role.

1 call to SearchCommentTest::setRolePermissions()
SearchCommentTest::testSearchResultsCommentAccess in core/modules/search/tests/src/Functional/SearchCommentTest.php
Verify access rules for comment indexing with different permissions.

File

core/modules/search/tests/src/Functional/SearchCommentTest.php, line 300

Class

SearchCommentTest
Tests integration searching comments.

Namespace

Drupal\Tests\search\Functional

Code

public function setRolePermissions($rid, $access_comments = FALSE, $search_content = TRUE) {
  $permissions = [
    'access comments' => $access_comments,
    'search content' => $search_content,
  ];
  user_role_change_permissions($rid, $permissions);
}