You are here

protected function FieldModuleUninstallValidatorTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Field/FieldModuleUninstallValidatorTest.php \Drupal\system\Tests\Field\FieldModuleUninstallValidatorTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides EntityUnitTestBase::setUp

File

core/modules/system/src/Tests/Field/FieldModuleUninstallValidatorTest.php, line 32
Contains \Drupal\system\Tests\Field\FieldModuleUninstallValidatorTest.

Class

FieldModuleUninstallValidatorTest
Tests FieldModuleUninstallValidator functionality.

Namespace

Drupal\system\Tests\Field

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('user', 'users_data');
  $this->entityDefinitionUpdateManager = $this->container
    ->get('entity.definition_update_manager');

  // Setup some fields for entity_test_extra to create.
  $definitions['extra_base_field'] = BaseFieldDefinition::create('string')
    ->setName('extra_base_field')
    ->setTargetEntityTypeId('entity_test')
    ->setTargetBundle('entity_test');
  $this->state
    ->set('entity_test.additional_base_field_definitions', $definitions);
  $definitions['extra_bundle_field'] = FieldStorageDefinition::create('string')
    ->setName('extra_bundle_field')
    ->setTargetEntityTypeId('entity_test')
    ->setTargetBundle('entity_test');
  $this->state
    ->set('entity_test.additional_field_storage_definitions', $definitions);
  $this->state
    ->set('entity_test.entity_test.additional_bundle_field_definitions', $definitions);
  $this->entityManager
    ->clearCachedDefinitions();
}