You are here

public function LocaleConfigSubscriberTest::testDeleteTranslation in Drupal 9

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

Tests deleting translations of shipped configuration.

1 method overrides LocaleConfigSubscriberTest::testDeleteTranslation()
LocaleConfigSubscriberForeignTest::testDeleteTranslation in core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberForeignTest.php
Tests deleting a translation override.

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');
}