You are here

public function ConfigFactoryTest::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php \Drupal\Tests\Core\Config\ConfigFactoryTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php, line 59
Contains \Drupal\Tests\Core\Config\ConfigFactoryTest.

Class

ConfigFactoryTest
@group Config @coversDefaultClass \Drupal\Core\Config\ConfigFactory

Namespace

Drupal\Tests\Core\Config

Code

public function setUp() {
  $this->storage = $this
    ->getMock('Drupal\\Core\\Config\\StorageInterface');
  $this->eventDispatcher = $this
    ->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
  $this->typedConfig = $this
    ->getMock('\\Drupal\\Core\\Config\\TypedConfigManagerInterface');
  $this->configFactory = new ConfigFactory($this->storage, $this->eventDispatcher, $this->typedConfig);
  $this->cacheTagsInvalidator = $this
    ->getMock('Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface');
  $container = new ContainerBuilder();
  $container
    ->set('cache_tags.invalidator', $this->cacheTagsInvalidator);
  \Drupal::setContainer($container);
}