function LocaleConfigSubscriberTest::assertNoTranslation

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

Ensures no translation exists.

@internal

Parameters

string $config_name: The configuration name.

string $langcode: The language code.

2 calls to LocaleConfigSubscriberTest::assertNoTranslation()
LocaleConfigSubscriberTest::setUpNoTranslation in core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
Sets up a configuration string without a translation.
LocaleConfigSubscriberTest::testLocaleDeleteTranslation in core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php
Tests deleting community translations of shipped configuration.

File

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

Class

LocaleConfigSubscriberTest
Tests that shipped configuration translations are updated correctly.

Namespace

Drupal\Tests\locale\Kernel

Code

protected function assertNoTranslation(string $config_name, string $langcode) : void {
    $strings = $this->stringStorage
        ->getTranslations([
        'type' => 'configuration',
        'name' => $config_name,
        'language' => $langcode,
        'translated' => TRUE,
    ]);
    $this->assertSame([], $strings);
}

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