You are here

public function TranslationTest::testFieldAccess in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/tests/src/Kernel/TranslationTest.php \Drupal\Tests\field\Kernel\TranslationTest::testFieldAccess()
  2. 10 core/modules/field/tests/src/Kernel/TranslationTest.php \Drupal\Tests\field\Kernel\TranslationTest::testFieldAccess()

Tests field access.

Regression test to verify that fieldAccess() can be called while only passing the required parameters.

See also

https://www.drupal.org/node/2404739

File

core/modules/field/tests/src/Kernel/TranslationTest.php, line 206

Class

TranslationTest
Tests multilanguage fields logic.

Namespace

Drupal\Tests\field\Kernel

Code

public function testFieldAccess() {
  $access_control_handler = \Drupal::entityTypeManager()
    ->getAccessControlHandler($this->entityType);
  $this
    ->assertTrue($access_control_handler
    ->fieldAccess('view', $this->field));
}