You are here

public function UncacheableEntityAccessControlHandlerTest::testAccess in Entity API 8

@covers ::checkAccess @covers ::checkEntityPermissions @covers ::checkEntityOwnerPermissions @covers ::checkCreateAccess

@dataProvider accessProvider

File

tests/src/Unit/UncacheableEntityAccessControlHandlerTest.php, line 54

Class

UncacheableEntityAccessControlHandlerTest
@coversDefaultClass \Drupal\entity\UncacheableEntityAccessControlHandler @group entity

Namespace

Drupal\Tests\entity\Unit

Code

public function testAccess(EntityInterface $entity, $operation, $account, $allowed) {
  $handler = new UncacheableEntityAccessControlHandler($entity
    ->getEntityType());
  $handler
    ->setStringTranslation($this
    ->getStringTranslationStub());
  $result = $handler
    ->access($entity, $operation, $account);
  $this
    ->assertEquals($allowed, $result);
}