protected function FieldEntityLinkTest::setUpFixtures in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php \Drupal\Tests\views\Kernel\Handler\FieldEntityLinkTest::setUpFixtures()
- 9 core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php \Drupal\Tests\views\Kernel\Handler\FieldEntityLinkTest::setUpFixtures()
File
- core/
modules/ views/ tests/ src/ Kernel/ Handler/ FieldEntityLinkTest.php, line 45
Class
- FieldEntityLinkTest
- Tests the core Drupal\views\Plugin\views\field\EntityOperations handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
protected function setUpFixtures() {
parent::setUpFixtures();
// Create the anonymous user account and set it as current user.
$this
->setUpCurrentUser([
'uid' => 0,
]);
$this
->installEntitySchema('entity_test');
$this
->installConfig([
'user',
]);
// Create some test entities.
for ($i = 0; $i < 5; $i++) {
EntityTest::create([
'name' => $this
->randomString(),
])
->save();
}
// Create and admin user.
$this->adminUser = $this
->createUser([
'view test entity',
], FALSE, TRUE);
Role::load(AccountInterface::ANONYMOUS_ROLE)
->grantPermission('view test entity')
->save();
}