You are here

public function FieldPermissionsServiceTest::testGetFieldAccess in Field Permissions 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/FieldPermissionsServiceTest.php \Drupal\Tests\field_permissions\Unit\FieldPermissionsServiceTest::testGetFieldAccess()

Test field access method.

@covers ::getFieldAccess

@dataProvider providerTestGetFieldAccess

File

tests/src/Unit/FieldPermissionsServiceTest.php, line 70

Class

FieldPermissionsServiceTest
Tests the field permissions service.

Namespace

Drupal\Tests\field_permissions\Unit

Code

public function testGetFieldAccess($operation, FieldItemListInterface $items, AccountInterface $account, FieldDefinitionInterface $field_definition, $expected_access) {
  $this
    ->assertEquals($expected_access, $this->fieldPermissionsService
    ->getFieldAccess($operation, $items, $account, $field_definition));
}