You are here

protected function FieldStorageConfigEntityUnitTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php \Drupal\Tests\field\Unit\FieldStorageConfigEntityUnitTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php, line 54
Contains \Drupal\Tests\field\Unit\FieldStorageConfigEntityUnitTest.

Class

FieldStorageConfigEntityUnitTest
@coversDefaultClass \Drupal\field\Entity\FieldStorageConfig

Namespace

Drupal\Tests\field\Unit

Code

protected function setUp() {
  $this->entityManager = $this
    ->getMock('\\Drupal\\Core\\Entity\\EntityManagerInterface');
  $this->uuid = $this
    ->getMock('\\Drupal\\Component\\Uuid\\UuidInterface');
  $this->fieldTypeManager = $this
    ->getMock(FieldTypePluginManagerInterface::class);
  $container = new ContainerBuilder();
  $container
    ->set('entity.manager', $this->entityManager);
  $container
    ->set('uuid', $this->uuid);
  $container
    ->set('plugin.manager.field.field_type', $this->fieldTypeManager);
  \Drupal::setContainer($container);
}