You are here

protected function EntityManagerTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php \Drupal\Tests\Core\Entity\EntityManagerTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php, line 63
Contains \Drupal\Tests\Core\Entity\EntityManagerTest.

Class

EntityManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityManager @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUp() {
  parent::setUp();
  $this->entityTypeManager = $this
    ->prophesize(EntityTypeManagerInterface::class);
  $this->entityTypeRepository = $this
    ->prophesize(EntityTypeRepositoryInterface::class);
  $this->entityTypeBundleInfo = $this
    ->prophesize(EntityTypeBundleInfoInterface::class);
  $this->entityFieldManager = $this
    ->prophesize(EntityFieldManagerInterface::class);
  $container = new ContainerBuilder();
  $container
    ->set('entity_type.manager', $this->entityTypeManager
    ->reveal());
  $container
    ->set('entity_type.repository', $this->entityTypeRepository
    ->reveal());
  $container
    ->set('entity_type.bundle.info', $this->entityTypeBundleInfo
    ->reveal());
  $container
    ->set('entity_field.manager', $this->entityFieldManager
    ->reveal());
  $this->entityManager = new EntityManager();
  $this->entityManager
    ->setContainer($container);
}