public function OgAccessHookTest::testGetEntityGroups in Organic groups 8
Tests that an administrator with 'administer group' permission has access.
@dataProvider permissionsProvider
File
- tests/src/ Unit/ OgAccessHookTest.php, line 45 
Class
- OgAccessHookTest
- Tests hook implementation of OG related access.
Namespace
Drupal\Tests\og\UnitCode
public function testGetEntityGroups($operation) {
  $this->user
    ->hasPermission('administer organic groups')
    ->willReturn(TRUE);
  $user_entity_access = og_entity_access($this->groupContentEntity
    ->reveal(), $operation, $this->user
    ->reveal());
  $this
    ->assertTrue($user_entity_access
    ->isAllowed());
}