class EntityTestViewsFieldAccessTest
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php \Drupal\Tests\views\Kernel\Handler\EntityTestViewsFieldAccessTest
Tests base field access in Views for the entity_test entity.
@group entity_test
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\views\Kernel\Handler\FieldFieldAccessTestBase implements \Drupal\Tests\views\Kernel\ViewsKernelTestBase
- class \Drupal\Tests\views\Kernel\Handler\EntityTestViewsFieldAccessTest implements \Drupal\Tests\views\Kernel\Handler\FieldFieldAccessTestBase
- class \Drupal\Tests\views\Kernel\Handler\FieldFieldAccessTestBase implements \Drupal\Tests\views\Kernel\ViewsKernelTestBase
- class \Drupal\Tests\views\Kernel\ViewsKernelTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of EntityTestViewsFieldAccessTest
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ EntityTestViewsFieldAccessTest.php, line 12
Namespace
Drupal\Tests\views\Kernel\HandlerView source
class EntityTestViewsFieldAccessTest extends FieldFieldAccessTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'entity_test',
];
/**
* {@inheritdoc}
*/
protected function setUp($import_test_views = TRUE) : void {
parent::setUp($import_test_views);
$this->installEntitySchema('entity_test');
}
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());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.