do not save edited users
This commit is contained in:
committed by
Ralf Haferkamp
parent
681ed49dc4
commit
0399398bc8
@@ -107,10 +107,6 @@ class GraphContext implements Context {
|
||||
): void {
|
||||
$response = $this->editUserUsingTheGraphApi($byUser, $user, $userName);
|
||||
$this->featureContext->setResponse($response);
|
||||
// need to add user to list to delete him after test
|
||||
if (!empty($userName) && $this->featureContext->getAttributeOfCreatedUser($userName, 'id')) {
|
||||
$this->featureContext->addUserToCreatedUsersList($userName, $this->featureContext->getUserPassword($user));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -287,9 +283,12 @@ class GraphContext implements Context {
|
||||
* @return ResponseInterface
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function adminDeletesUserUsingTheGraphApi(string $user, ?string $byUser = null): ResponseInterface {
|
||||
public function adminDeletesUserUsingTheGraphApi(string $user, ?string $byUser = null): ?ResponseInterface {
|
||||
$credentials = $this->getAdminOrUserCredentials($byUser);
|
||||
$userId = $this->featureContext->getAttributeOfCreatedUser($user, 'id');
|
||||
if ($userId === null) {
|
||||
throw new \RuntimeException("Cannot delete user '$user': no userId found");
|
||||
}
|
||||
return GraphHelper::deleteUserByUserId(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getStepLineRef(),
|
||||
|
||||
Reference in New Issue
Block a user