File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ Given as user :user
5252Given user :user exists
5353Given sending :verb to :url
5454Given the response should be a JSON array with the following mandatory values
55+ Given guest :guest exists
5556Given /^set the display name of user "([^"]*)" to "([^"]*)"$/
5657Given /^set the email of user "([^"]*)" to "([^"]*)"$/
5758Given sending :verb to ocs :url
Original file line number Diff line number Diff line change @@ -94,6 +94,19 @@ public function assureUserExists(string $user): void {
9494 }
9595 }
9696
97+ #[Given('guest :guest exists ' )]
98+ public function assureGuestExists (string $ guest ): void {
99+ $ response = $ this ->userExists ($ guest );
100+ if ($ response ->getStatusCode () !== 200 ) {
101+ static ::createAnEnvironmentWithValueToBeUsedByOccCommand ('OC_PASS ' , '123456 ' );
102+ $ this ->runCommandWithResultCode ('guests:add admin ' . $ guest . ' --password-from-env ' , 0 );
103+ // Set a display name different than the user ID to be able to
104+ // ensure in the tests that the right value was returned.
105+ $ this ->setUserDisplayName ($ guest );
106+ self ::$ createdUsers [] = $ guest ;
107+ }
108+ }
109+
97110 protected function userExists (string $ user ): ResponseInterface {
98111 $ currentUser = $ this ->currentUser ;
99112 $ this ->setCurrentUser ('admin ' );
You can’t perform that action at this time.
0 commit comments