You are here

protected function FieldConfigAccessControlHandlerTest::setUp in Drupal 9

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

Overrides FieldStorageConfigAccessControlHandlerTest::setUp

File

core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php, line 20

Class

FieldConfigAccessControlHandlerTest
Tests the field config access controller.

Namespace

Drupal\Tests\field\Unit

Code

protected function setUp() : void {
  parent::setUp();
  $this->entity = new FieldConfig([
    'field_name' => $this->entity
      ->getName(),
    'entity_type' => 'node',
    'fieldStorage' => $this->entity,
    'bundle' => 'test_bundle',
    'field_type' => 'test_field',
  ], 'node');
  $this->accessControlHandler = new FieldConfigAccessControlHandler($this->entity
    ->getEntityType());
  $this->accessControlHandler
    ->setModuleHandler($this->moduleHandler);
}