do not save edited users

This commit is contained in:
Viktor Scharf
2025-10-08 16:45:16 +02:00
committed by Ralf Haferkamp
parent 681ed49dc4
commit 0399398bc8
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -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(),