You are here

public function ConfigTranslationListUiTest::doUserRoleListTest in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php \Drupal\config_translation\Tests\ConfigTranslationListUiTest::doUserRoleListTest()

Tests the role listing for the translate operation.

1 call to ConfigTranslationListUiTest::doUserRoleListTest()
ConfigTranslationListUiTest::testTranslateOperationInListUi in core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
Tests if translate link is added to operations in all configuration lists.

File

core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php, line 305
Contains \Drupal\config_translation\Tests\ConfigTranslationListUiTest.

Class

ConfigTranslationListUiTest
Visit all lists.

Namespace

Drupal\config_translation\Tests

Code

public function doUserRoleListTest() {

  // Create a test role to decouple looking for translate operations
  // link so this does not test more than necessary.
  $role_id = Unicode::strtolower($this
    ->randomMachineName(16));
  $this
    ->drupalCreateRole(array(), $role_id);

  // Get the role listing.
  $this
    ->drupalGet('admin/people/roles');
  $translate_link = 'admin/people/roles/manage/' . $role_id . '/translate';

  // Test if the link to translate the role is on the page.
  $this
    ->assertLinkByHref($translate_link);

  // Test if the link to translate actually goes to the translate page.
  $this
    ->drupalGet($translate_link);
  $this
    ->assertRaw('<th>' . t('Language') . '</th>');
}