You are here

protected function EntityReferenceTestBase::buildContainer in Feeds 8.3

Builds the Drupal service container.

3 calls to EntityReferenceTestBase::buildContainer()
ConfigEntityReferenceTest::setUp in tests/src/Unit/Feeds/Target/ConfigEntityReferenceTest.php
EntityReferenceTest::setUp in tests/src/Unit/Feeds/Target/EntityReferenceTest.php
UserRoleTest::setUp in tests/src/Unit/Feeds/Target/UserRoleTest.php

File

tests/src/Unit/Feeds/Target/EntityReferenceTestBase.php, line 94

Class

EntityReferenceTestBase
Base class for entity reference target tests.

Namespace

Drupal\Tests\feeds\Unit\Feeds\Target

Code

protected function buildContainer() {

  // EntityReference::prepareTarget() accesses the entity type manager from
  // the global container.
  // @see \Drupal\feeds\Feeds\Target\EntityReference::prepareTarget()
  $container = new ContainerBuilder();
  $container
    ->set('entity_type.manager', $this->entityTypeManager
    ->reveal());
  $container
    ->set('string_translation', $this
    ->getStringTranslationStub());
  \Drupal::setContainer($container);
}