function LocaleConfigSubscriberTest::testDeleteTranslation

Same name in other branches
  1. 9 core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest::testDeleteTranslation()
  2. 8.9.x core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest::testDeleteTranslation()
  3. 11.x 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 167

Class

LocaleConfigSubscriberTest
Tests that shipped configuration translations are updated correctly.

Namespace

Drupal\Tests\locale\Kernel

Code

public function testDeleteTranslation() : void {
    $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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.