function EntityFormDisplayAccessControlHandlerTest::testAccess
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php \Drupal\Tests\Core\Entity\Access\EntityFormDisplayAccessControlHandlerTest::testAccess()
- 8.9.x core/tests/Drupal/Tests/Core/Entity/Access/EntityFormDisplayAccessControlHandlerTest.php \Drupal\Tests\Core\Entity\Access\EntityFormDisplayAccessControlHandlerTest::testAccess()
- 11.x 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() : void {
$this->assertAllowOperations([], $this->anon);
$this->assertAllowOperations([
'view',
'update',
'delete',
], $this->member);
$this->assertAllowOperations([
'view',
'update',
'delete',
], $this->parentMember);
$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->parentMember);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.