You are here

public function PermissionsByTermDrupalSubContext::createEditorRole in Permissions by Term 8.2

@Given /^editor role exists$/

File

tests/src/Behat/Context/permissions_by_term.behat.inc, line 289

Class

PermissionsByTermDrupalSubContext
Class PermissionsByTermContext

Namespace

Drupal\Tests\permissions_by_term\Behat\PermissionsByTermDrupalSubContext

Code

public function createEditorRole() {
  if (!Role::load('editor')) {
    $role = Role::create([
      'id' => 'editor',
    ]);
    $role
      ->grantPermission('edit any article content')
      ->save();
  }
}