You are here

public function LocaleConfigSubscriberTest::testDeleteTranslation in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest::testDeleteTranslation()
  2. 9 core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest::testDeleteTranslation()

Tests deleting translations of shipped configuration.

File

core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php, line 165

Class

LocaleConfigSubscriberTest
Tests that shipped configuration translations are updated correctly.

Namespace

Drupal\Tests\locale\Kernel

Code

public function testDeleteTranslation() {
  $config_name = 'locale_test.translation';
  $this
    ->deleteLanguageOverride($config_name, 'test', 'English test', 'de');

  // Instead of deleting the translation, we need to keep a translation with
  // the source value and mark it as customized to prevent the deletion being
  // reverted by importing community translations.
  $this
    ->assertTranslation($config_name, 'English test', 'de');
}