public function DefaultRoleEventTest::testDeleteRole in Organic groups 8
Tests deleting OG roles from the default role event.
@covers ::deleteRole
@dataProvider defaultRoleProvider
Parameters
array $roles: An array of test default roles.
File
- tests/
src/ Unit/ DefaultRoleEventTest.php, line 178
Class
- DefaultRoleEventTest
- Tests default role events.
Namespace
Drupal\Tests\og\UnitCode
public function testDeleteRole(array $roles) {
$this
->expectOgRoleCreation($roles);
$this->defaultRoleEvent
->setRoles($roles);
foreach ($roles as $name => $role) {
$this
->assertTrue($this->defaultRoleEvent
->hasRole($name));
$this->defaultRoleEvent
->deleteRole($name);
$this
->assertFalse($this->defaultRoleEvent
->hasRole($name));
}
}