You are here

public function EntityTestViewsFieldAccessTest::testEntityTestFields in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Handler/EntityTestViewsFieldAccessTest.php \Drupal\views\Tests\Handler\EntityTestViewsFieldAccessTest::testEntityTestFields()

File

core/modules/views/src/Tests/Handler/EntityTestViewsFieldAccessTest.php, line 32
Contains \Drupal\views\Tests\Handler\EntityTestViewsFieldAccessTest.

Class

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

Namespace

Drupal\views\Tests\Handler

Code

public function testEntityTestFields() {
  $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());
}