Skip to content

Commit

Permalink
Merge pull request #52 from LibreSign/bugfix/change-display-name
Browse files Browse the repository at this point in the history
Chagne display name
  • Loading branch information
vitormattos authored Mar 8, 2024
2 parents 7230c87 + ca57df7 commit 232409b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/NextcloudApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ protected function createUser(string $user): void {
}

/** @When /^set the display name of user "([^"]*)" to "([^"]*)"$/ */
public function setUserDisplayName(string $user): void {
public function setUserDisplayName(string $user, ?string $displayName = null): void {
$currentUser = $this->currentUser;
$this->setCurrentUser('admin');
$displayName = $displayName ?? $user . '-displayname';
$this->sendOCSRequest('PUT', '/cloud/users/' . $user, [
'key' => 'displayname',
'value' => $user . '-displayname'
'value' => $displayName,
]);
$this->setCurrentUser($currentUser);
}
Expand Down

0 comments on commit 232409b

Please sign in to comment.