You are here

class TestConfigNamesMapper in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php \Drupal\Tests\config_translation\Unit\TestConfigNamesMapper
  2. 9 core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php \Drupal\Tests\config_translation\Unit\TestConfigNamesMapper

Defines a test mapper class.

Hierarchy

Expanded class hierarchy of TestConfigNamesMapper

File

core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php, line 659
Contains \Drupal\Tests\config_translation\Unit\ConfigNamesMapperTest.

Namespace

Drupal\Tests\config_translation\Unit
View source
class TestConfigNamesMapper extends ConfigNamesMapper {

  /**
   * Gets the internal language code of this mapper, if any.
   *
   * This method is not to be confused with
   * ConfigMapperInterface::getLangcode().
   *
   * @return string|null
   *   The language code of this mapper if it is set; NULL otherwise.
   */
  public function getInternalLangcode() {
    return $this->langcode ?? NULL;
  }

  /**
   * Sets the list of configuration names.
   *
   * @param array $config_names
   *   The configuration names.
   */
  public function setConfigNames(array $config_names) {
    $this->pluginDefinition['names'] = $config_names;
  }

  /**
   * Sets the configuration factory.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The config factory to set.
   */
  public function setConfigFactory(ConfigFactoryInterface $config_factory) {
    $this->configFactory = $config_factory;
  }

}

Members