You are here

protected function ConfigMapperManagerTest::setUp in Zircon Profile 8

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

Overrides UnitTestCase::setUp

File

core/modules/config_translation/tests/src/Unit/ConfigMapperManagerTest.php, line 38
Contains \Drupal\Tests\config_translation\Unit\ConfigMapperManagerTest.

Class

ConfigMapperManagerTest
Tests the functionality provided by configuration translation mapper manager.

Namespace

Drupal\Tests\config_translation\Unit

Code

protected function setUp() {
  $language = new Language(array(
    'id' => 'en',
  ));
  $language_manager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $language_manager
    ->expects($this
    ->once())
    ->method('getCurrentLanguage')
    ->with(LanguageInterface::TYPE_INTERFACE)
    ->will($this
    ->returnValue($language));
  $this->typedConfigManager = $this
    ->getMockBuilder('Drupal\\Core\\Config\\TypedConfigManagerInterface')
    ->getMock();
  $module_handler = $this
    ->getMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $theme_handler = $this
    ->getMock('Drupal\\Core\\Extension\\ThemeHandlerInterface');
  $this->configMapperManager = new ConfigMapperManager($this
    ->getMock('Drupal\\Core\\Cache\\CacheBackendInterface'), $language_manager, $module_handler, $this->typedConfigManager, $theme_handler);
}