You are here

public function DefaultRoleEventTest::testOffsetSet in Organic groups 8

Tests "offsetSet".

@covers ::offsetSet

@dataProvider defaultRoleProvider

Parameters

array $roles: An array of test default roles.

File

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

Class

DefaultRoleEventTest
Tests default role events.

Namespace

Drupal\Tests\og\Unit

Code

public function testOffsetSet(array $roles) {
  $this
    ->expectOgRoleCreation($roles);
  foreach ($roles as $name => $role) {
    $this
      ->assertFalse($this->defaultRoleEvent
      ->hasRole($name));
    $this->defaultRoleEvent[$name] = $role;
    $this
      ->assertRoleEquals($role, $this->defaultRoleEvent
      ->getRole($name));
  }
}