public function ConfigTranslationOverviewTest::testListingPageWithOverrides in Drupal 10
Same name and namespace in other branches
- 8 core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php \Drupal\Tests\config_translation\Functional\ConfigTranslationOverviewTest::testListingPageWithOverrides()
- 9 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
->assertEquals($overridden_label, $config_test_storage
->load('dotted.default')
->label());
// Test that the original label on the listing page is intact.
$this
->drupalGet('admin/config/regional/config-translation/config_test');
$this
->assertSession()
->pageTextContains($original_label);
$this
->assertSession()
->pageTextNotContains($overridden_label);
}