public function DefaultRoleEventTest::testSetInvalidRole in Organic groups 8
Tests setting an invalid OG role for the default role event.
@covers ::setRole
@dataProvider invalidDefaultRoleProvider
Parameters
array $invalid_roles: An array of invalid test default roles.
File
- tests/
src/ Unit/ DefaultRoleEventTest.php, line 370
Class
- DefaultRoleEventTest
- Tests default role events.
Namespace
Drupal\Tests\og\UnitCode
public function testSetInvalidRole(array $invalid_roles) {
$this
->expectOgRoleCreation($invalid_roles);
$this
->expectException(\InvalidArgumentException::class);
foreach ($invalid_roles as $invalid_role) {
$this->defaultRoleEvent
->setRole($invalid_role);
}
}