function ConfigTranslationOverviewTest::testListingPageWithOverrides
Same name in other branches
- 9 core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationOverviewTest::testListingPageWithOverrides()
- 10 core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationOverviewTest::testListingPageWithOverrides()
- 11.x 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\FunctionalCode
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.