function EntityTypeManagerTest::setUp

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::setUp()
  2. 10 core/tests/Drupal/Tests/Core/Entity/EntityTypeManagerTest.php \Drupal\Tests\Core\Entity\EntityTypeManagerTest::setUp()
  3. 11.x 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 80

Class

EntityTypeManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityTypeManager @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

protected function setUp() {
    parent::setUp();
    $this->moduleHandler = $this->prophesize(ModuleHandlerInterface::class);
    $this->moduleHandler
        ->getImplementations('entity_type_build')
        ->willReturn([]);
    $this->moduleHandler
        ->alter('entity_type', Argument::type('array'))
        ->willReturn(NULL);
    $this->cacheBackend = $this->prophesize(CacheBackendInterface::class);
    $this->translationManager = $this->prophesize(TranslationInterface::class);
    $this->entityLastInstalledSchemaRepository = $this->prophesize(EntityLastInstalledSchemaRepositoryInterface::class);
    $this->entityTypeManager = new TestEntityTypeManager(new \ArrayObject(), $this->moduleHandler
        ->reveal(), $this->cacheBackend
        ->reveal(), $this->translationManager
        ->reveal(), $this->getClassResolverStub(), $this->entityLastInstalledSchemaRepository
        ->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.