You are here

public function DefaultRoleEventTest::testOffsetUnset in Organic groups 8

Tests "testOffsetUnset".

@covers ::offsetUnset

@dataProvider defaultRoleProvider

Parameters

array $roles: An array of test default roles.

File

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

Class

DefaultRoleEventTest
Tests default role events.

Namespace

Drupal\Tests\og\Unit

Code

public function testOffsetUnset(array $roles) {
  $this
    ->expectOgRoleCreation($roles);
  $this->defaultRoleEvent
    ->setRoles($roles);
  foreach ($roles as $name => $role) {
    $this
      ->assertTrue($this->defaultRoleEvent
      ->hasRole($name));
    unset($this->defaultRoleEvent[$name]);
    $this
      ->assertFalse($this->defaultRoleEvent
      ->hasRole($name));
  }
}