function TranslationTest::testFieldAccess

Same name 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()
  3. 11.x 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));
}

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