function FieldConfigAccessControlHandlerTest::setUp

Same name in other branches
  1. 9 core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php \Drupal\Tests\field\Unit\FieldConfigAccessControlHandlerTest::setUp()
  2. 10 core/modules/field/tests/src/Unit/FieldConfigAccessControlHandlerTest.php \Drupal\Tests\field\Unit\FieldConfigAccessControlHandlerTest::setUp()
  3. 11.x 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() {
    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);
}

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