You are here

protected function BlazyManagerUnitTestTrait::setUpUnitContainer in Blazy 8

Same name and namespace in other branches
  1. 8.2 tests/src/Traits/BlazyManagerUnitTestTrait.php \Drupal\Tests\blazy\Traits\BlazyManagerUnitTestTrait::setUpUnitContainer()

Setup the unit manager.

4 calls to BlazyManagerUnitTestTrait::setUpUnitContainer()
BlazyAdminExtendedUnitTest::setUp in tests/src/Unit/Form/BlazyAdminExtendedUnitTest.php
BlazyAdminFormatterUnitTest::setUp in tests/src/Unit/Form/BlazyAdminFormatterUnitTest.php
BlazyManagerUnitTest::setUp in tests/src/Unit/BlazyManagerUnitTest.php
BlazyUnitTest::setUp in tests/src/Unit/BlazyUnitTest.php

File

tests/src/Traits/BlazyManagerUnitTestTrait.php, line 48

Class

BlazyManagerUnitTestTrait
A Trait common for Blazy related service managers.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function setUpUnitContainer() {
  $container = new ContainerBuilder();
  $container
    ->set('entity.manager', $this->entityManager);
  $container
    ->set('entity_field.manager', $this->entityFieldManager);
  $container
    ->set('entity_type.manager', $this->entityTypeManager);
  $container
    ->set('module_handler', $this->moduleHandler);
  $container
    ->set('renderer', $this->renderer);
  $container
    ->set('config.factory', $this->configFactory);
  $container
    ->set('cache.default', $this->cache);
  $container
    ->set('token', $this->token);
  \Drupal::setContainer($container);
  $this->blazyManager = new BlazyManager($this->entityTypeManager, $this->moduleHandler, $this->renderer, $this->configFactory, $this->cache);
}