You are here

public function DefaultRoleEventTest::testOffsetExists in Organic groups 8

Tests "testOffsetExists".

@covers ::offsetExists

@dataProvider defaultRoleProvider

Parameters

array $roles: An array of test default roles.

File

tests/src/Unit/DefaultRoleEventTest.php, line 282

Class

DefaultRoleEventTest
Tests default role events.

Namespace

Drupal\Tests\og\Unit

Code

public function testOffsetExists(array $roles) {
  $this
    ->expectOgRoleCreation($roles);
  foreach ($roles as $name => $role) {
    $this
      ->assertFalse(isset($this->defaultRoleEvent[$name]));
    $this->defaultRoleEvent
      ->addRole($role);
    $this
      ->assertTrue(isset($this->defaultRoleEvent[$name]));
  }
}