3 namespace Drupal\Tests\field\Unit;
5 use Drupal\field\Entity\FieldConfig;
6 use Drupal\field\FieldConfigAccessControlHandler;
9 * Tests the field config access controller.
13 * @coversDefaultClass \Drupal\field\FieldConfigAccessControlHandler
15 class FieldConfigAccessControlHandlerTest extends FieldStorageConfigAccessControlHandlerTest {
20 protected function setUp() {
23 $this->entity = new FieldConfig([
24 'field_name' => $this->entity->getName(),
25 'entity_type' => 'node',
26 'fieldStorage' => $this->entity,
27 'bundle' => 'test_bundle',
28 'field_type' => 'test_field',
31 $this->accessControlHandler = new FieldConfigAccessControlHandler($this->entity->getEntityType());
32 $this->accessControlHandler->setModuleHandler($this->moduleHandler);
36 * Ensures field config access is working properly.
38 public function testAccess() {
39 $this->assertAllowOperations([], $this->anon);
40 $this->assertAllowOperations(['view', 'update', 'delete'], $this->member);