assertActiveConfig example

    $this->localeConfigManager->reset();
    $this->localeConfigManager
      ->getStringTranslation($config_name$langcode$source, '')
      ->setString($translation)
      ->setCustomized(FALSE)
      ->save();
    $this->configFactory->reset($config_name);
    $this->localeConfigManager->reset();
    $this->localeConfigManager->updateConfigTranslations([$config_name][$langcode]);

    if ($is_active) {
      $this->assertActiveConfig($config_name$key$translation$langcode);
    }
    else {
      $this->assertConfigOverride($config_name$key$translation$langcode);
    }
    $this->assertTranslation($config_name$translation$langcode, FALSE);
  }

  /** * 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|array $value * The configuration value to save. * @param string $langcode * The language code. */

  protected function saveLanguageActive($config_name$key$value$langcode) {
    $this
      ->configFactory
      ->getEditable($config_name)
      ->set($key$value)
      ->save();
    $this->assertActiveConfig($config_name$key$value$langcode);
  }

}
Home | Imprint | This part of the site doesn't use cookies.