class TestConfigNamesMapper
Same name and namespace in other branches
- 10 core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php \Drupal\Tests\config_translation\Unit\TestConfigNamesMapper
- 9 core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php \Drupal\Tests\config_translation\Unit\TestConfigNamesMapper
- 8.9.x core/modules/config_translation/tests/src/Unit/ConfigNamesMapperTest.php \Drupal\Tests\config_translation\Unit\TestConfigNamesMapper
Defines a test mapper class.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\config_translation\ConfigNamesMapper implements \Drupal\config_translation\ConfigMapperInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Tests\config_translation\Unit\TestConfigNamesMapper extends \Drupal\config_translation\ConfigNamesMapper
- class \Drupal\config_translation\ConfigNamesMapper implements \Drupal\config_translation\ConfigMapperInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\DependencyInjection\AutowiredInstanceTrait, \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of TestConfigNamesMapper
File
-
core/
modules/ config_translation/ tests/ src/ Unit/ ConfigNamesMapperTest.php, line 654
Namespace
Drupal\Tests\config_translation\UnitView 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) : void {
$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) : void {
$this->configFactory = $config_factory;
}
}
Members
| Title Sort descending | Deprecated | Modifiers | Object type | Summary | Overriden Title | Overrides |
|---|---|---|---|---|---|---|
| AutowiredInstanceTrait::createInstanceAutowired | public static | function | Instantiates a new instance of the implementing class using autowiring. | |||
| ConfigNamesMapper::$baseRoute | protected | property | The base route object that the mapper is attached to. | |||
| ConfigNamesMapper::$configFactory | protected | property | The configuration factory. | |||
| ConfigNamesMapper::$configMapperManager | protected | property | The mapper plugin discovery service. | |||
| ConfigNamesMapper::$eventDispatcher | protected | property | The event dispatcher. | |||
| ConfigNamesMapper::$langcode | protected | property | The language code of the language this mapper, if any. | |||
| ConfigNamesMapper::$languageManager | protected | property | The language manager. | |||
| ConfigNamesMapper::$localeConfigManager | protected | property | The typed configuration manager. | |||
| ConfigNamesMapper::$routeCollection | protected | property | The available routes. | |||
| ConfigNamesMapper::$routeProvider | protected | property | The route provider. | |||
| ConfigNamesMapper::$typedConfigManager | protected | property | The typed config manager. | |||
| ConfigNamesMapper::addConfigName | public | function | Adds the given configuration name to the list of names. | Overrides ConfigMapperInterface::addConfigName | ||
| ConfigNamesMapper::create | public static | function | Instantiates a new instance of the implementing class using autowiring. | Overrides PluginBase::create | 1 | |
| ConfigNamesMapper::getAddRoute | public | function | Returns the route object for a translation add form route. | Overrides ConfigMapperInterface::getAddRoute | ||
| ConfigNamesMapper::getAddRouteName | public | function | Returns route name for the translation add form route. | Overrides ConfigMapperInterface::getAddRouteName | ||
| ConfigNamesMapper::getAddRouteParameters | public | function | Returns the route parameters for the translation add form route. | Overrides ConfigMapperInterface::getAddRouteParameters | ||
| ConfigNamesMapper::getBasePath | public | function | Returns a processed path for the base route the mapper is attached to. | Overrides ConfigMapperInterface::getBasePath | ||
| ConfigNamesMapper::getBaseRoute | public | function | Returns the base route object the mapper is attached to. | Overrides ConfigMapperInterface::getBaseRoute | ||
| ConfigNamesMapper::getBaseRouteName | public | function | Returns the name of the base route the mapper is attached to. | Overrides ConfigMapperInterface::getBaseRouteName | ||
| ConfigNamesMapper::getBaseRouteParameters | public | function | Returns the route parameters for the base route the mapper is attached to. | Overrides ConfigMapperInterface::getBaseRouteParameters | 1 | |
| ConfigNamesMapper::getConfigData | public | function | Returns an array with all configuration data. | Overrides ConfigMapperInterface::getConfigData | ||
| ConfigNamesMapper::getConfigNames | public | function | Returns an array of configuration names for the mapper. | Overrides ConfigMapperInterface::getConfigNames | ||
| ConfigNamesMapper::getContextualLinkGroup | public | function | Returns the name of the contextual link group to add contextual links to. | Overrides ConfigMapperInterface::getContextualLinkGroup | 1 | |
| ConfigNamesMapper::getDeleteRoute | public | function | Returns the route object for the translation deletion route. | Overrides ConfigMapperInterface::getDeleteRoute | ||
| ConfigNamesMapper::getDeleteRouteName | public | function | Returns route name for the translation deletion route. | Overrides ConfigMapperInterface::getDeleteRouteName | ||
| ConfigNamesMapper::getDeleteRouteParameters | public | function | Returns the route parameters for the translation deletion route. | Overrides ConfigMapperInterface::getDeleteRouteParameters | ||
| ConfigNamesMapper::getEditRoute | public | function | Returns the route object for a translation edit form route. | Overrides ConfigMapperInterface::getEditRoute | ||
| ConfigNamesMapper::getEditRouteName | public | function | Returns route name for the translation edit form route. | Overrides ConfigMapperInterface::getEditRouteName | ||
| ConfigNamesMapper::getEditRouteParameters | public | function | Returns the route parameters for the translation edit form route. | Overrides ConfigMapperInterface::getEditRouteParameters | ||
| ConfigNamesMapper::getLangcode | public | function | Returns the original language code of the configuration. | Overrides ConfigMapperInterface::getLangcode | ||
| ConfigNamesMapper::getLangcodeFromConfig | public | function | Returns the language code of a configuration object given its name. | Overrides ConfigMapperInterface::getLangcodeFromConfig | ||
| ConfigNamesMapper::getOperations | public | function | Provides an array of information to build a list of operation links. | Overrides ConfigMapperInterface::getOperations | 1 | |
| ConfigNamesMapper::getOverviewPath | public | function | Returns a processed path for the translation overview route. | Overrides ConfigMapperInterface::getOverviewPath | ||
| ConfigNamesMapper::getOverviewRoute | public | function | Returns the route object for a translation overview route. | Overrides ConfigMapperInterface::getOverviewRoute | ||
| ConfigNamesMapper::getOverviewRouteName | public | function | Returns route name for the translation overview route. | Overrides ConfigMapperInterface::getOverviewRouteName | 1 | |
| ConfigNamesMapper::getOverviewRouteParameters | public | function | Returns the route parameters for the translation overview route. | Overrides ConfigMapperInterface::getOverviewRouteParameters | ||
| ConfigNamesMapper::getTitle | public | function | Returns title of this translation page. | Overrides ConfigMapperInterface::getTitle | 1 | |
| ConfigNamesMapper::getTypeLabel | public | function | Returns the label of the type of data the mapper encapsulates. | Overrides ConfigMapperInterface::getTypeLabel | 1 | |
| ConfigNamesMapper::getTypeName | public | function | Returns the name of the type of data the mapper encapsulates. | Overrides ConfigMapperInterface::getTypeName | 1 | |
| ConfigNamesMapper::getWeight | public | function | Returns the weight of the mapper. | Overrides ConfigMapperInterface::getWeight | ||
| ConfigNamesMapper::hasSchema | public | function | Checks that all pieces of this configuration mapper have a schema. | Overrides ConfigMapperInterface::hasSchema | ||
| ConfigNamesMapper::hasTranslatable | public | function | Checks if pieces of this configuration mapper have translatables. | Overrides ConfigMapperInterface::hasTranslatable | ||
| ConfigNamesMapper::hasTranslation | public | function | Checks whether there is already a translation for this mapper. | Overrides ConfigMapperInterface::hasTranslation | ||
| ConfigNamesMapper::populateFromRouteMatch | public | function | Populate the config mapper with route match data. | Overrides ConfigMapperInterface::populateFromRouteMatch | 1 | |
| ConfigNamesMapper::processRoute | protected | function | Allows to process all config translation routes. | 1 | ||
| ConfigNamesMapper::setLangcode | public | function | Sets the original language code. | Overrides ConfigMapperInterface::setLangcode | ||
| ConfigNamesMapper::setRouteCollection | public | function | Sets the route collection. | Overrides ConfigMapperInterface::setRouteCollection | ||
| ConfigNamesMapper::__construct | public | function | Constructs a ConfigNamesMapper. | Overrides PluginBase::__construct | 1 | |
| DependencySerializationTrait::$_entityStorages | protected | property | An array of entity type IDs keyed by the property name of their storages. | |||
| DependencySerializationTrait::$_serviceIds | protected | property | An array of service IDs keyed by property name used for serialization. | |||
| DependencySerializationTrait::__sleep | public | function | 2 | |||
| DependencySerializationTrait::__wakeup | public | function | 2 | |||
| MessengerTrait::$messenger | protected | property | The messenger. | 27 | ||
| MessengerTrait::messenger | public | function | Gets the messenger. | 27 | ||
| MessengerTrait::setMessenger | public | function | Sets the messenger. | |||
| PluginBase::$configuration | protected | property | Configuration information passed into the plugin. | 1 | ||
| PluginBase::$pluginDefinition | protected | property | The plugin implementation definition. | 1 | ||
| PluginBase::$pluginId | protected | property | The plugin ID. | |||
| PluginBase::DERIVATIVE_SEPARATOR | constant | A string which is used to separate base plugin IDs from the derivative ID. | ||||
| PluginBase::getBaseId | public | function | Gets the base_plugin_id of the plugin instance. | Overrides DerivativeInspectionInterface::getBaseId | ||
| PluginBase::getDerivativeId | public | function | Gets the derivative_id of the plugin instance. | Overrides DerivativeInspectionInterface::getDerivativeId | ||
| PluginBase::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | Overrides PluginInspectionInterface::getPluginDefinition | 2 | |
| PluginBase::getPluginId | public | function | Gets the plugin ID of the plugin instance. | Overrides PluginInspectionInterface::getPluginId | ||
| PluginBase::isConfigurable | Deprecated | public | function | Determines if the plugin is configurable. | ||
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | ||
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | |||
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | |||
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | |||
| StringTranslationTrait::setStringTranslation | public | function | Sets the string translation service to use. | 2 | ||
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | 1 | ||
| TestConfigNamesMapper::getInternalLangcode | public | function | Gets the internal language code of this mapper, if any. | |||
| TestConfigNamesMapper::setConfigFactory | public | function | Sets the configuration factory. | |||
| TestConfigNamesMapper::setConfigNames | public | function | Sets the list of configuration names. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.