function ConfigFieldMapperTest::setUp

Same name in other branches
  1. 9 core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigFieldMapperTest::setUp()
  2. 10 core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigFieldMapperTest::setUp()
  3. 11.x core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigFieldMapperTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/config_translation/tests/src/Unit/ConfigFieldMapperTest.php, line 48

Class

ConfigFieldMapperTest
Tests the functionality provided by the configuration field mapper.

Namespace

Drupal\Tests\config_translation\Unit

Code

protected function setUp() {
    $this->entityTypeManager = $this->createMock('Drupal\\Core\\Entity\\EntityTypeManagerInterface');
    $this->entity = $this->createMock('Drupal\\field\\FieldConfigInterface');
    $definition = [
        'class' => '\\Drupal\\config_translation\\ConfigFieldMapper',
        'base_route_name' => 'entity.field_config.node_field_edit_form',
        'title' => '@label field',
        'names' => [],
        'entity_type' => 'field_config',
    ];
    $locale_config_manager = $this->getMockBuilder('Drupal\\locale\\LocaleConfigManager')
        ->disableOriginalConstructor()
        ->getMock();
    $this->eventDispatcher = $this->createMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
    $this->configFieldMapper = new ConfigFieldMapper('node_fields', $definition, $this->getConfigFactoryStub(), $this->createMock('Drupal\\Core\\Config\\TypedConfigManagerInterface'), $locale_config_manager, $this->createMock('Drupal\\config_translation\\ConfigMapperManagerInterface'), $this->createMock('Drupal\\Core\\Routing\\RouteProviderInterface'), $this->getStringTranslationStub(), $this->entityTypeManager, $this->createMock('Drupal\\Core\\Language\\LanguageManagerInterface'), $this->eventDispatcher);
}

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