public function AreaEntityTest::testEntityArea in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php \Drupal\Tests\views\Kernel\Handler\AreaEntityTest::testEntityArea()
- 9 core/modules/views/tests/src/Kernel/Handler/AreaEntityTest.php \Drupal\Tests\views\Kernel\Handler\AreaEntityTest::testEntityArea()
Tests the area handler.
File
- core/
modules/ views/ tests/ src/ Kernel/ Handler/ AreaEntityTest.php, line 92
Class
- AreaEntityTest
- Tests the generic entity area handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
public function testEntityArea() {
/** @var \Drupal\Core\Entity\EntityInterface[] $entities */
$entities = [];
for ($i = 0; $i < 3; $i++) {
$random_label = $this
->randomMachineName();
$data = [
'bundle' => 'entity_test',
'name' => $random_label,
];
$entity_test = $this->container
->get('entity_type.manager')
->getStorage('entity_test')
->create($data);
$uuid_map[0] = 'aa0c61cb-b7bb-4795-972a-493dabcf529c';
$uuid_map[1] = '62cef0ff-6f30-4f7a-b9d6-a8ed5a3a6bf3';
$uuid_map[2] = '3161d6e9-3326-4719-b513-8fa68a731ba2';
$entity_test->uuid->value = $uuid_map[$i];
$entity_test
->save();
$entities[] = $entity_test;
\Drupal::state()
->set('entity_test_entity_access.view.' . $entity_test
->id(), $i != 2);
}
$this
->doTestCalculateDependencies();
$this
->doTestRender($entities);
}