function EntityReferenceSupportedNewEntitiesConstraintValidatorTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::setUp()
  2. 8.9.x core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::setUp()
  3. 10 core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php \Drupal\Tests\workspaces\Kernel\EntityReferenceSupportedNewEntitiesConstraintValidatorTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php, line 43

Class

EntityReferenceSupportedNewEntitiesConstraintValidatorTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21workspaces%21src%21Plugin%21Validation%21Constraint%21EntityReferenceSupportedNewEntitiesConstraintValidator.php/class/EntityReferenceSupportedNewEntitiesConstraintValidator/11.x" title="Checks if new entities created for entity reference fields are supported." class="local">\Drupal\workspaces\Plugin\Validation\Constraint\EntityReferenceSupportedNewEntitiesConstraintValidator</a> @group workspaces

Namespace

Drupal\Tests\workspaces\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->installEntitySchema('user');
    $this->createUser();
    $fields['supported_reference'] = BaseFieldDefinition::create('entity_reference')->setSetting('target_type', 'entity_test_mulrevpub');
    $fields['unsupported_reference'] = BaseFieldDefinition::create('entity_reference')->setSetting('target_type', 'entity_test');
    $this->container
        ->get('state')
        ->set('entity_test_mulrevpub.additional_base_field_definitions', $fields);
    $this->installEntitySchema('entity_test_mulrevpub');
    $this->initializeWorkspacesModule();
}

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