function ConfigFactoryTest::setUp

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php \Drupal\Tests\Core\Config\ConfigFactoryTest::setUp()
  2. 10 core/tests/Drupal/Tests/Core/Config/ConfigFactoryTest.php \Drupal\Tests\Core\Config\ConfigFactoryTest::setUp()
  3. 11.x 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 54

Class

ConfigFactoryTest
@group Config @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Config%21ConfigFactory.php/class/ConfigFactory/9" title="Defines the configuration object factory." class="local">\Drupal\Core\Config\ConfigFactory</a>

Namespace

Drupal\Tests\Core\Config

Code

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

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