function EntityDisplayModeBaseUnitTest::setUp

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

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php, line 53

Class

EntityDisplayModeBaseUnitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityDisplayModeBase.php/class/EntityDisplayModeBase/9" title="Base class for config entity types with settings for form and view modes." class="local">\Drupal\Core\Entity\EntityDisplayModeBase</a> @group Config

Namespace

Drupal\Tests\Core\Config\Entity

Code

protected function setUp() : void {
    $this->entityType = $this->randomMachineName();
    $this->entityInfo = $this->createMock('\\Drupal\\Core\\Entity\\EntityTypeInterface');
    $this->entityInfo
        ->expects($this->any())
        ->method('getProvider')
        ->willReturn('entity');
    $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $this->uuid = $this->createMock('\\Drupal\\Component\\Uuid\\UuidInterface');
    $container = new ContainerBuilder();
    $container->set('entity_type.manager', $this->entityTypeManager);
    $container->set('uuid', $this->uuid);
    \Drupal::setContainer($container);
}

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