Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / views / tests / src / Kernel / Handler / EntityTestViewsFieldAccessTest.php
1 <?php
2
3 namespace Drupal\Tests\views\Kernel\Handler;
4
5 use Drupal\entity_test\Entity\EntityTest;
6
7 /**
8  * Tests base field access in Views for the entity_test entity.
9  *
10  * @group entity_test
11  */
12 class EntityTestViewsFieldAccessTest extends FieldFieldAccessTestBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static $modules = ['entity_test'];
18
19   /**
20    * {@inheritdoc}
21    */
22   protected function setUp($import_test_views = TRUE) {
23     parent::setUp($import_test_views);
24
25     $this->installEntitySchema('entity_test');
26   }
27
28   public function testEntityTestFields() {
29     $entity_test = EntityTest::create([
30       'name' => 'test entity name',
31     ]);
32     $entity_test->save();
33
34     // @todo Expand the test coverage in https://www.drupal.org/node/2464635
35
36     $this->assertFieldAccess('entity_test', 'id', $entity_test->id());
37     $this->assertFieldAccess('entity_test', 'langcode', $entity_test->language()->getName());
38     $this->assertFieldAccess('entity_test', 'name', $entity_test->getName());
39   }
40
41 }