public function ApidocEntityRevisionsAccessTest::testApiDocRevisionsAccessLoggedIn in Apigee API Catalog 8
Test ApiDocs revision access a logged in user.
File
- tests/
src/ Kernel/ ApidocEntityRevisionsAccessTest.php, line 140
Class
- ApidocEntityRevisionsAccessTest
- Tests the ApiDoc entity access permissions.
Namespace
Drupal\Tests\apigee_api_catalog\KernelCode
public function testApiDocRevisionsAccessLoggedIn() {
$user = $this
->createUser([]);
$this->container
->get('account_switcher')
->switchTo($user);
$entity_v1 = $this->entityTypeStorage
->loadRevision($this->apidocV1Id);
$tests = [
'view' => 'LoggedIn should not be able to view an unpublished revision.',
'update' => 'LoggedIn should not be able to update a revision.',
];
foreach ($tests as $op => $message) {
$this
->assertFalse($entity_v1
->access($op, $user), $message);
}
}