Skip to content

Commit da74bed

Browse files
authored
Added seeUserHasRoles function (#80)
1 parent c268bf4 commit da74bed

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Codeception/Module/Symfony.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,23 @@ public function dontSeeRememberedAuthentication(): void
11551155
);
11561156
}
11571157

1158+
/**
1159+
* Verifies that the current user has multiple roles
1160+
*
1161+
* ``` php
1162+
* <?php
1163+
* $I->seeUserHasRoles(['ROLE_USER', 'ROLE_ADMIN']);
1164+
* ```
1165+
*
1166+
* @param string[] $roles
1167+
*/
1168+
public function seeUserHasRoles(array $roles): void
1169+
{
1170+
foreach ($roles as $role) {
1171+
$this->seeUserHasRole($role);
1172+
}
1173+
}
1174+
11581175
/**
11591176
* Check that the current user has a role
11601177
*

0 commit comments

Comments
 (0)