You are here

public function ContentModerationStateAccessControlHandlerTest::testHandler in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateAccessControlHandlerTest::testHandler()

@covers ::checkAccess @covers ::checkCreateAccess

File

core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php, line 46

Class

ContentModerationStateAccessControlHandlerTest
@coversDefaultClass \Drupal\content_moderation\ContentModerationStateAccessControlHandler @group content_moderation

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function testHandler() {
  $entity = ContentModerationState::create([]);
  $this
    ->assertFalse($this->accessControlHandler
    ->access($entity, 'view'));
  $this
    ->assertFalse($this->accessControlHandler
    ->access($entity, 'update'));
  $this
    ->assertFalse($this->accessControlHandler
    ->access($entity, 'delete'));
  $this
    ->assertFalse($this->accessControlHandler
    ->createAccess());
}