diff --git a/src/NextcloudApiContext.php b/src/NextcloudApiContext.php index ac60beb..04c82dd 100644 --- a/src/NextcloudApiContext.php +++ b/src/NextcloudApiContext.php @@ -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); }