public function AreaEntityTest::testEntityArea in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Tests/Handler/AreaEntityTest.php \Drupal\views\Tests\Handler\AreaEntityTest::testEntityArea()
Tests the area handler.
File
- core/
modules/ views/ src/ Tests/ Handler/ AreaEntityTest.php, line 93 - Contains \Drupal\views\Tests\Handler\AreaEntityTest.
Class
- AreaEntityTest
- Tests the generic entity area handler.
Namespace
Drupal\views\Tests\HandlerCode
public function testEntityArea() {
/** @var \Drupal\Core\Entity\EntityInterface[] $entities */
$entities = array();
for ($i = 0; $i < 3; $i++) {
$random_label = $this
->randomMachineName();
$data = array(
'bundle' => 'entity_test',
'name' => $random_label,
);
$entity_test = $this->container
->get('entity.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);
}