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