You are here

public function ConfigTranslationListUiTest::doFormatsListTest 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::doFormatsListTest()

Tests the formats listing for the translate operation.

1 call to ConfigTranslationListUiTest::doFormatsListTest()
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 257
Contains \Drupal\config_translation\Tests\ConfigTranslationListUiTest.

Class

ConfigTranslationListUiTest
Visit all lists.

Namespace

Drupal\config_translation\Tests

Code

public function doFormatsListTest() {

  // Create a test format to decouple looking for translate operations
  // link so this does not test more than necessary.
  $filter_format = entity_create('filter_format', array(
    'format' => Unicode::strtolower($this
      ->randomMachineName(16)),
    'name' => $this
      ->randomMachineName(),
  ));
  $filter_format
    ->save();

  // Get the format listing.
  $this
    ->drupalGet('admin/config/content/formats');
  $translate_link = 'admin/config/content/formats/manage/' . $filter_format
    ->id() . '/translate';

  // Test if the link to translate the format 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>');
}