function EntityTypeManagerTest::setUp

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::setUp()
  3. 10 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php, line 77

Class

EntityTypeManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityTypeManager[[api-linebreak]] @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUp() : void {
  parent::setUp();
  $this->moduleHandler = $this->prophesize(ModuleHandlerInterface::class);
  $this->cacheBackend = $this->prophesize(CacheBackendInterface::class);
  $this->translationManager = $this->prophesize(TranslationInterface::class);
  $this->entityLastInstalledSchemaRepository = $this->prophesize(EntityLastInstalledSchemaRepositoryInterface::class);
  $container = $this->prophesize(Container::class);
  $this->entityTypeManager = new TestEntityTypeManager(new \ArrayObject(), $this->moduleHandler
    ->reveal(), $this->cacheBackend
    ->reveal(), $this->translationManager
    ->reveal(), $this->getClassResolverStub(), $this->entityLastInstalledSchemaRepository
    ->reveal(), $container->reveal());
  $this->discovery = $this->prophesize(DiscoveryInterface::class);
  $this->entityTypeManager
    ->setDiscovery($this->discovery
    ->reveal());
}

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