You are here

public function DefaultRoleEventTest::testInvalidOffsetSet in Organic groups 8

Tests "offsetSet".

@covers ::offsetSet

@dataProvider invalidDefaultRoleProvider

Parameters

array $invalid_roles: An array of invalid test default roles.

File

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

Class

DefaultRoleEventTest
Tests default role events.

Namespace

Drupal\Tests\og\Unit

Code

public function testInvalidOffsetSet(array $invalid_roles) {
  $this
    ->expectOgRoleCreation($invalid_roles);
  foreach ($invalid_roles as $name => $invalid_role) {
    $this
      ->expectException(\InvalidArgumentException::class);
    $this->defaultRoleEvent[$name] = $invalid_role;
  }
}