public function EntityFormDisplayAccessControlHandlerTest::testAccess in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php \Drupal\Tests\Core\Entity\Access\EntityFormDisplayAccessControlHandlerTest::testAccess()
@covers ::access @covers ::checkAccess
File
- core/
tests/ Drupal/ Tests/ Core/ Entity/ Access/ EntityFormDisplayAccessControlHandlerTest.php, line 218
Class
- EntityFormDisplayAccessControlHandlerTest
- @coversDefaultClass \Drupal\Core\Entity\Entity\Access\EntityFormDisplayAccessControlHandler @group Entity
Namespace
Drupal\Tests\Core\Entity\AccessCode
public function testAccess() {
$this
->assertAllowOperations([], $this->anon);
$this
->assertAllowOperations([
'view',
'update',
'delete',
], $this->member);
$this
->assertAllowOperations([
'view',
'update',
'delete',
], $this->parent_member);
$this->entity
->enforceIsNew(TRUE)
->save();
// Unfortunately, EntityAccessControlHandler has a static cache, which we
// therefore must reset manually.
$this->accessControlHandler
->resetCache();
$this
->assertAllowOperations([], $this->anon);
$this
->assertAllowOperations([
'view',
'update',
], $this->member);
$this
->assertAllowOperations([
'view',
'update',
], $this->parent_member);
}