do not save edited users

This commit is contained in:
Viktor Scharf
2025-09-29 12:11:07 +02:00
committed by Ralf Haferkamp
parent 681ed49dc4
commit 0399398bc8
2 changed files with 5 additions and 6 deletions

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(),

View File

@@ -74,7 +74,7 @@ Feature: edit user
And the user "Alice" has deleted a user "sam"
When the user "Alice" changes the user name of user "Brian" to "sam" using the Graph API
Then the HTTP status code should be "200"
And the user information of "sam" should match this JSON schema
And the user information of "Brian" should match this JSON schema
"""
{
"type": "object",