assertNoConfigOverride example

    $this->localeConfigManager->updateConfigTranslations([$config_name]['en']);
    $this->assertConfigOverride($config_name, 'test', 'English test', 'en');

    $this->configFactory->getEditable('locale.settings')->set('translate_english', TRUE)->save();
    $this->saveLocaleTranslationData($config_name, 'test', 'English test', 'Updated English test', 'en');
    $this->assertTranslation($config_name, 'Updated English test', 'en', FALSE);

    $this->saveLanguageOverride($config_name, 'test', 'Updated English', 'en');
    $this->assertTranslation($config_name, 'Updated English', 'en');

    $this->deleteLocaleTranslationData($config_name, 'test', 'English test', 'en');
    $this->assertNoConfigOverride($config_name, 'en');
  }

  /** * Saves a language override. * * This will invoke LocaleConfigSubscriber through the event dispatcher. To * make sure the configuration was persisted correctly, the configuration * value is checked. Because LocaleConfigSubscriber temporarily disables the * override state of the configuration factory we check that the correct value * is restored afterwards. * * @param string $config_name * The configuration name. * @param string $key * The configuration key. * @param string $value * The configuration value to save. * @param string $langcode * The language code. */

  protected function setUpNoTranslation($config_name$key$source$langcode) {
    $this->localeConfigManager->updateConfigTranslations([$config_name][$langcode]);
    $this->assertNoConfigOverride($config_name$key);
    $this->assertNoTranslation($config_name$langcode);
  }

  /** * Sets up a configuration string with a translation. * * The actual configuration is already available by installing locale_test * module, as it is done in LocaleConfigSubscriberTest::setUp(). This sets up * the necessary source and translation strings and verifies that everything * is as expected to avoid false positives. * * @param string $config_name * The configuration name. * @param string $key * The configuration key. * @param string $source * The source string. * @param string $translation * The translation string. * @param string $langcode * The language code. * @param bool $is_active * Whether the update will affect the active configuration. */
Home | Imprint | This part of the site doesn't use cookies.