function EntityTestViewsFieldAccessTest::testEntityTestFields

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php \Drupal\Tests\views\Kernel\Handler\EntityTestViewsFieldAccessTest::testEntityTestFields()
  2. 8.9.x core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php \Drupal\Tests\views\Kernel\Handler\EntityTestViewsFieldAccessTest::testEntityTestFields()
  3. 11.x core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php \Drupal\Tests\views\Kernel\Handler\EntityTestViewsFieldAccessTest::testEntityTestFields()

File

core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php, line 33

Class

EntityTestViewsFieldAccessTest
Tests base field access in Views for the entity_test entity.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testEntityTestFields() : void {
    $entity_test = EntityTest::create([
        'name' => 'test entity name',
    ]);
    $entity_test->save();
    // @todo Expand the test coverage in https://www.drupal.org/node/2464635
    $this->assertFieldAccess('entity_test', 'id', $entity_test->id());
    $this->assertFieldAccess('entity_test', 'langcode', $entity_test->language()
        ->getName());
    $this->assertFieldAccess('entity_test', 'name', $entity_test->getName());
}

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