You are here

protected function EntityDisplayTraitTest::setUp in CCK Select Other 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/EntityDisplayTraitTest.php, line 30

Class

EntityDisplayTraitTest
Tests the entity display trait.

Namespace

Drupal\Tests\cck_select_other\Unit

Code

protected function setUp() {
  $this->mock = $this
    ->getMockForTrait('Drupal\\cck_select_other\\EntityDisplayTrait');

  // Mock the entity manager.
  $this->entityManager = $this
    ->getMockBuilder('\\Drupal\\Core\\Entity\\EntityTypeManagerInterface')
    ->disableOriginalConstructor()
    ->getMock();
  $container = new ContainerBuilder();
  $container
    ->set('entity_type.manager', $this->entityManager);
  \Drupal::setContainer($container);
}