You are here

public function LocaleConfigSubscriberTest::testDeleteTranslation in Zircon Profile 8.0

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

Tests deleting translations of shipped configuration.

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

File

core/modules/locale/src/Tests/LocaleConfigSubscriberTest.php, line 154
Contains \Drupal\locale\Tests\LocaleConfigSubscriberTest.

Class

LocaleConfigSubscriberTest
Tests that shipped configuration translations are updated correctly.

Namespace

Drupal\locale\Tests

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