You are here

protected function AbstractTestMessageUi::grantMessageUiPermission in Message UI 8

Grant to the user a specific permission.

Parameters

string $operation: The template of operation - create, update, delete or view.

string $template: The message template.

2 calls to AbstractTestMessageUi::grantMessageUiPermission()
MessageUiPermissionsTest::testMessageUiPermissions in tests/src/Functional/MessageUiPermissionsTest.php
Test message_access use case.
MessageUiShowPreviewTest::setUp in tests/src/Functional/MessageUiShowPreviewTest.php

File

tests/src/Functional/AbstractTestMessageUi.php, line 41

Class

AbstractTestMessageUi
Abstract class for Message UI tests.

Namespace

Drupal\Tests\message_ui\Functional

Code

protected function grantMessageUiPermission($operation, $template = 'foo') {
  user_role_grant_permissions($this->rid, [
    $operation . ' ' . $template . ' message',
  ]);
}