function LocaleConfigSubscriberTest::testCreateTranslationMultiValue

Same name in other branches
  1. 9 core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest::testCreateTranslationMultiValue()
  2. 10 core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest::testCreateTranslationMultiValue()
  3. 11.x core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php \Drupal\Tests\locale\Kernel\LocaleConfigSubscriberTest::testCreateTranslationMultiValue()

Tests creating translations configuration with multi value settings.

File

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

Class

LocaleConfigSubscriberTest
Tests that shipped configuration translations are updated correctly.

Namespace

Drupal\Tests\locale\Kernel

Code

public function testCreateTranslationMultiValue() {
    $config_name = 'locale_test.translation_multiple';
    $this->saveLanguageOverride($config_name, 'test_multiple', [
        'string' => 'String (German)',
        'another_string' => 'Another string (German)',
    ], 'de');
    $this->saveLanguageOverride($config_name, 'test_after_multiple', [
        'string' => 'After string (German)',
        'another_string' => 'After another string (German)',
    ], 'de');
    $strings = $this->stringStorage
        ->getTranslations([
        'type' => 'configuration',
        'name' => $config_name,
        'language' => 'de',
        'translated' => TRUE,
    ]);
    $this->assertCount(5, $strings);
}

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