You are here

public function LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  2. 4.0.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  3. 3.0.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  4. 3.1.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  5. 3.2.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  6. 3.3.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  7. 3.4.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  8. 3.6.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  9. 3.7.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()
  10. 3.8.x tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php \Drupal\Tests\lingotek\Functional\LingotekManageLingotekTranslationsPermissionTest::testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission()

Tests that a user can navigate to the config bulk translation pages.

File

tests/src/Functional/LingotekManageLingotekTranslationsPermissionTest.php, line 143

Class

LingotekManageLingotekTranslationsPermissionTest
Tests different permissions of the Lingotek module.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testNavigationThroughSiteForBulkConfigTranslationAsTranslationsManagerWithTranslateConfigPermission() {
  $assert_session = $this
    ->assertSession();

  // Login as translations manager, but including the 'translate configuration'
  // permission.
  $roles = $this->translationManagerUser
    ->getRoles(TRUE);

  /** @var \Drupal\user\RoleInterface $role */
  $role = Role::load($roles[0]);
  $role
    ->grantPermission('translate configuration')
    ->save();
  $this
    ->drupalLogin($this->translationManagerUser);
  $this
    ->drupalGet('/user');

  // Assert the toolbar has the proper links for configuration and translation.
  $assert_session
    ->linkExists('Configuration');
  $assert_session
    ->linkExists('Translation');

  // Assert in the configuration panes we have access to Lingotek Translation.
  $this
    ->clickLink('Configuration');
  $this
    ->assertText('Regional and language');
  $this
    ->clickLink('Lingotek Translation');

  // Assert we see the dashboard and can navigate to config.
  $assert_session
    ->linkExists('Config');
  $this
    ->clickLink('Config');
  $this
    ->assertText('Manage Configuration Translation');
}