You are here

public function SearchCommentTest::setRolePermissions in Drupal 10

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

Set permissions for role.

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);
}