public function DefaultRoleEventTest::testAddInvalidRoles in Organic groups 8
Tests adding invalid OG roles to the default role event.
@covers ::addRoles
@dataProvider invalidDefaultRoleProvider
Parameters
array $invalid_roles: An array of invalid test default roles.
File
- tests/
src/ Unit/ DefaultRoleEventTest.php, line 352
Class
- DefaultRoleEventTest
- Tests default role events.
Namespace
Drupal\Tests\og\UnitCode
public function testAddInvalidRoles(array $invalid_roles) {
$this
->expectOgRoleCreation($invalid_roles);
$this
->expectException(\InvalidArgumentException::class);
$this->defaultRoleEvent
->addRoles($invalid_roles);
$this
->fail('An array of invalid roles cannot be added.');
}