chore: Adapt integration test to API change

Trying to create an auth token from an authtoken
 returns 403 now, not 503 (which is more correct)

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2026-06-16 14:40:42 +02:00 committed by backportbot[bot]
parent 78ee9202a9
commit 2a86a0d617
2 changed files with 4 additions and 3 deletions

View file

@ -104,7 +104,7 @@ Feature: auth
Then the HTTP status code should be "200"
When the CSRF token is extracted from the previous response
When a new unrestricted client token is added using restricted basic token auth
Then the HTTP status code should be "503"
Then the HTTP status code should be "403"
Scenario: Creating a restricted auth token with regular login should work
When a new restricted client token is added
@ -113,4 +113,3 @@ Feature: auth
Scenario: Creating an unrestricted auth token with regular login should work
When a new unrestricted client token is added
Then the HTTP status code should be "200"

View file

@ -93,7 +93,9 @@ trait Auth {
try {
$this->response = $client->request('POST', $fullUrl, $options);
} catch (\GuzzleHttp\Exception\ServerException $e) {
} catch (ClientException $ex) {
$this->response = $ex->getResponse();
} catch (ServerException $e) {
$this->response = $e->getResponse();
}
return json_decode($this->response->getBody()->getContents());