function ContentModerationStateAccessControlHandlerTest::testHandler

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateAccessControlHandlerTest::testHandler()
  2. 8.9.x core/modules/content_moderation/tests/src/Kernel/ContentModerationStateAccessControlHandlerTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationStateAccessControlHandlerTest::testHandler()
  3. 11.x 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() : void {
    $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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.