You are here

public function LocalTranslatorTest::testUserPermissionsAccess in Translation Management Tool 8

Test permissions for the tmgmt_local VBO actions.

File

translators/tmgmt_local/tests/src/Functional/LocalTranslatorTest.php, line 971

Class

LocalTranslatorTest
Basic tests for the local translator.

Namespace

Drupal\Tests\tmgmt_local\Functional

Code

public function testUserPermissionsAccess() {
  $permissions = [
    'administer tmgmt',
    'create translation jobs',
    'accept translation jobs',
    'administer translation tasks',
  ];
  foreach ($permissions as $permission) {
    $user = $this
      ->drupalCreateUser([
      $permission,
    ]);
    $this
      ->drupalLogin($user);
    $this
      ->drupalGet('admin/tmgmt');
    $this
      ->assertText('Translation');
  }
  $user = $this
    ->drupalCreateUser([
    'provide translation services',
  ]);
  $this
    ->drupalLogin($user);
  $this
    ->drupalGet('admin/tmgmt');
  $this
    ->assertText('Local Tasks');
}