From 732c4cc1abcc6f94e21c8bc0e20fb69b0e5bb5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 23 Jul 2026 16:27:35 +0200 Subject: [PATCH] Fix failing tests --- .../Services/VCSGitea/VCSGiteaConsoleClientTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/VCSGitea/VCSGiteaConsoleClientTest.php b/tests/e2e/Services/VCSGitea/VCSGiteaConsoleClientTest.php index a719709576..a9739ef55a 100644 --- a/tests/e2e/Services/VCSGitea/VCSGiteaConsoleClientTest.php +++ b/tests/e2e/Services/VCSGitea/VCSGiteaConsoleClientTest.php @@ -25,10 +25,14 @@ final class VCSGiteaConsoleClientTest extends Scope public function testCreateInstallation(): void { $projectId = $this->getProject()['$id']; + $consoleUrl = 'http://localhost/console/project-default-' . $projectId . '/settings/git-installations'; $authorize = $this->client->call(Client::METHOD_GET, '/vcs/gitea/authorize', array_merge([ 'x-appwrite-project' => $projectId, - ], $this->getHeaders()), [], true, false); + ], $this->getHeaders()), [ + 'success' => $consoleUrl, + 'failure' => $consoleUrl, + ], true, false); $this->assertEquals(301, $authorize['headers']['status-code']); @@ -95,7 +99,7 @@ final class VCSGiteaConsoleClientTest extends Scope ], true, false); $this->assertEquals(301, $callback['headers']['status-code']); - $this->assertStringContainsString('git-installations', (string) ($callback['headers']['location'] ?? '')); + $this->assertEquals($consoleUrl, $callback['headers']['location'] ?? ''); $installations = $this->client->call(Client::METHOD_GET, '/vcs/installations', array_merge([ 'x-appwrite-project' => $projectId, @@ -116,7 +120,7 @@ final class VCSGiteaConsoleClientTest extends Scope $this->assertNotEmpty($installation['$id']); $this->assertEquals('gitea', $installation['provider']); $this->assertEquals(self::GITEA_USERNAME, $installation['organization']); - $this->assertTrue($installation['personal']); + $this->assertNotEmpty($installation['providerInstallationId']); } // Client does not persist cookies between calls, so carry them manually and never follow redirects