You are here

public function ConfigTranslationOverviewTest::testListingPageWithOverrides 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::testListingPageWithOverrides()
  2. 10 core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationOverviewTest::testListingPageWithOverrides()

Tests that overrides do not affect listing screens.

File

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

Class

ConfigTranslationOverviewTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function testListingPageWithOverrides() {
  $original_label = 'Default';
  $overridden_label = 'Overridden label';
  $config_test_storage = $this->container
    ->get('entity_type.manager')
    ->getStorage('config_test');

  // Set up an override.
  $settings['config']['config_test.dynamic.dotted.default']['label'] = (object) [
    'value' => $overridden_label,
    'required' => TRUE,
  ];
  $this
    ->writeSettings($settings);

  // Test that the overridden label is loaded with the entity.
  $this
    ->assertEqual($config_test_storage
    ->load('dotted.default')
    ->label(), $overridden_label);

  // Test that the original label on the listing page is intact.
  $this
    ->drupalGet('admin/config/regional/config-translation/config_test');
  $this
    ->assertText($original_label);
  $this
    ->assertNoText($overridden_label);
}