You are here

public function OgAccessTest::testAccessByOperation in Organic groups 8

Tests access to entity.

@coversDefaultmethod ::userAccess @dataProvider permissionsProvider

File

tests/src/Unit/OgAccessTest.php, line 33

Class

OgAccessTest
Tests access.

Namespace

Drupal\Tests\og\Unit

Code

public function testAccessByOperation($operation) {
  $user_access = $this->ogAccess
    ->userAccess($this->group, $operation, $this->user
    ->reveal());

  // We populate the allowed permissions cache in
  // OgAccessTestBase::setup().
  $condition = $operation == 'update group' ? $user_access
    ->isAllowed() : $user_access
    ->isNeutral();
  $this
    ->assertTrue($condition);
}