expand createUser.feature (#6662)

This commit is contained in:
Viktor Scharf
2023-06-29 18:10:49 +02:00
committed by GitHub
parent 8f9564edb8
commit f0d99683f0
4 changed files with 104 additions and 16 deletions
@@ -1952,6 +1952,20 @@ class GraphContext implements Context {
);
}
/**
* @Then /^the Graph API response should have no role$/
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function theGraphApiResponseShouldHaveNoRole(): void {
Assert::assertEmpty(
$this->featureContext->getJsonDecodedResponse($this->featureContext->getResponse())['value'],
"the user has a role, but should not"
);
}
/**
* @When user :user gets details of the group :groupName using the Graph API
*
@@ -2402,7 +2416,7 @@ class GraphContext implements Context {
* @throws GuzzleException
*/
public function getAssignedRole(string $user) {
$userId = $this->featureContext->getAttributeOfCreatedUser($user, 'id') ?? $user;
$userId = $this->featureContext->getAttributeOfCreatedUser($user, 'id') ?? $this->featureContext->getUserIdByUserName($user);
return (
GraphHelper::getAssignedRole(
$this->featureContext->getBAseUrl(),