You are here

public function ApidocEntityRevisionsAccessTest::testApiDocRevisionsAccessAnon in Apigee API Catalog 8

Test ApiDocs revision access as anonymous.

File

tests/src/Kernel/ApidocEntityRevisionsAccessTest.php, line 124

Class

ApidocEntityRevisionsAccessTest
Tests the ApiDoc entity access permissions.

Namespace

Drupal\Tests\apigee_api_catalog\Kernel

Code

public function testApiDocRevisionsAccessAnon() {
  $entity_v1 = $this->entityTypeStorage
    ->loadRevision($this->apidocV1Id);
  $tests = [
    'view' => 'Anonymous should not be able to view an unpublished revision.',
    'update' => 'Anonymous should not be able to update a revision.',
  ];
  foreach ($tests as $op => $message) {
    $this
      ->assertFalse($entity_v1
      ->access($op), $message);
  }
}