You are here

public function ConfigTranslationOverviewTest::testListingFieldsPage in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationOverviewTest::testListingFieldsPage()
  2. 10 core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationOverviewTest::testListingFieldsPage()

Tests the field listing for the translate operation.

File

core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php, line 182

Class

ConfigTranslationOverviewTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function testListingFieldsPage() {

  // Create a content type.
  $node_type = NodeType::create([
    'type' => 'basic',
    'name' => 'Basic',
  ]);
  $node_type
    ->save();
  $field = FieldConfig::create([
    // The field storage is guaranteed to exist because it is supplied by the
    // node module.
    'field_storage' => FieldStorageConfig::loadByName('node', 'body'),
    'bundle' => $node_type
      ->id(),
    'label' => 'Body',
    'settings' => [
      'display_summary' => FALSE,
    ],
  ]);
  $field
    ->save();
  $this
    ->drupalGet('admin/config/regional/config-translation/node_fields');
  $this
    ->assertText('Body');
  $this
    ->assertText('Basic');
  $this
    ->assertLinkByHref('admin/structure/types/manage/basic/fields/node.basic.body/translate');
}