You are here

protected function ConfigEntityMapperTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php \Drupal\Tests\config_translation\Unit\ConfigEntityMapperTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php, line 57
Contains \Drupal\Tests\config_translation\Unit\ConfigEntityMapperTest.

Class

ConfigEntityMapperTest
Tests the functionality provided by the configuration entity mapper.

Namespace

Drupal\Tests\config_translation\Unit

Code

protected function setUp() {
  $this->entityManager = $this
    ->getMock('Drupal\\Core\\Entity\\EntityManagerInterface');
  $this->entity = $this
    ->getMock('Drupal\\Core\\Config\\Entity\\ConfigEntityInterface');
  $this->routeProvider = $this
    ->getMock('Drupal\\Core\\Routing\\RouteProviderInterface');
  $this->routeProvider
    ->expects($this
    ->any())
    ->method('getRouteByName')
    ->with('entity.configurable_language.edit_form')
    ->will($this
    ->returnValue(new Route('/admin/config/regional/language/edit/{configurable_language}')));
  $definition = array(
    'class' => '\\Drupal\\config_translation\\ConfigEntityMapper',
    'base_route_name' => 'entity.configurable_language.edit_form',
    'title' => '@label language',
    'names' => array(),
    'entity_type' => 'configurable_language',
    'route_name' => 'config_translation.item.overview.entity.configurable_language.edit_form',
  );
  $typed_config_manager = $this
    ->getMock('Drupal\\Core\\Config\\TypedConfigManagerInterface');
  $locale_config_manager = $this
    ->getMockBuilder('Drupal\\locale\\LocaleConfigManager')
    ->disableOriginalConstructor()
    ->getMock();
  $this->languageManager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $this->configEntityMapper = new ConfigEntityMapper('configurable_language', $definition, $this
    ->getConfigFactoryStub(), $typed_config_manager, $locale_config_manager, $this
    ->getMock('Drupal\\config_translation\\ConfigMapperManagerInterface'), $this->routeProvider, $this
    ->getStringTranslationStub(), $this->entityManager, $this->languageManager);
}