From 2a86a0d617ebca79b7fcbee8e3a68c179fab9bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 16 Jun 2026 14:40:42 +0200 Subject: [PATCH] chore: Adapt integration test to API change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trying to create an auth token from an authtoken returns 403 now, not 503 (which is more correct) Signed-off-by: Côme Chilliet --- build/integration/features/auth.feature | 3 +-- build/integration/features/bootstrap/Auth.php | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/integration/features/auth.feature b/build/integration/features/auth.feature index f9c8b7d0e46..4601221c808 100644 --- a/build/integration/features/auth.feature +++ b/build/integration/features/auth.feature @@ -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" - diff --git a/build/integration/features/bootstrap/Auth.php b/build/integration/features/bootstrap/Auth.php index d95aca8ea35..3ba596f8f24 100644 --- a/build/integration/features/bootstrap/Auth.php +++ b/build/integration/features/bootstrap/Auth.php @@ -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());