diff --git a/composer.lock b/composer.lock index 8220b30c..20e2f044 100644 --- a/composer.lock +++ b/composer.lock @@ -206,23 +206,23 @@ }, { "name": "google/protobuf", - "version": "v4.33.5", + "version": "v4.33.6", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "ebe8010a61b2ae0cff0d246fe1c4d44e9f7dfa6d" + "reference": "84b008c23915ed94536737eae46f41ba3bccfe67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ebe8010a61b2ae0cff0d246fe1c4d44e9f7dfa6d", - "reference": "ebe8010a61b2ae0cff0d246fe1c4d44e9f7dfa6d", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/84b008c23915ed94536737eae46f41ba3bccfe67", + "reference": "84b008c23915ed94536737eae46f41ba3bccfe67", "shasum": "" }, "require": { "php": ">=8.1.0" }, "require-dev": { - "phpunit/phpunit": ">=5.0.0 <8.5.27" + "phpunit/phpunit": ">=10.5.62 <11.0.0" }, "suggest": { "ext-bcmath": "Need to support JSON deserialization" @@ -244,9 +244,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.5" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.6" }, - "time": "2026-01-29T20:49:00+00:00" + "time": "2026-03-18T17:32:05+00:00" }, { "name": "nyholm/psr7", @@ -4048,16 +4048,16 @@ }, { "name": "utopia-php/system", - "version": "0.10.0", + "version": "0.10.1", "source": { "type": "git", "url": "https://github.com/utopia-php/system.git", - "reference": "6441a9c180958a373e5ddb330264dd638539dfdb" + "reference": "7c1669533bb9c285de19191270c8c1439161a78a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/system/zipball/6441a9c180958a373e5ddb330264dd638539dfdb", - "reference": "6441a9c180958a373e5ddb330264dd638539dfdb", + "url": "https://api.github.com/repos/utopia-php/system/zipball/7c1669533bb9c285de19191270c8c1439161a78a", + "reference": "7c1669533bb9c285de19191270c8c1439161a78a", "shasum": "" }, "require": { @@ -4098,9 +4098,9 @@ ], "support": { "issues": "https://github.com/utopia-php/system/issues", - "source": "https://github.com/utopia-php/system/tree/0.10.0" + "source": "https://github.com/utopia-php/system/tree/0.10.1" }, - "time": "2025-10-15T19:12:00+00:00" + "time": "2026-03-15T21:07:41+00:00" } ], "aliases": [], @@ -4112,5 +4112,5 @@ "php": ">=8.0" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/src/VCS/Adapter/Git/GitHub.php b/src/VCS/Adapter/Git/GitHub.php index 84e7e177..32afa0aa 100644 --- a/src/VCS/Adapter/Git/GitHub.php +++ b/src/VCS/Adapter/Git/GitHub.php @@ -637,7 +637,7 @@ public function getUser(string $username): array * Get owner name of the GitHub installation * * @param string $installationId GitHub App installation ID - * @param int|null $repositoryId Not used by GitHub (parameter exists for Gitea compatibility) + * @param int|null $repositoryId Not used by GitHub (parameter exists for this adapter compatibility) * @return string Owner login/username */ public function getOwnerName(string $installationId, ?int $repositoryId = null): string diff --git a/src/VCS/Adapter/Git/Gitea.php b/src/VCS/Adapter/Git/Gitea.php index d6ed8e13..09488929 100644 --- a/src/VCS/Adapter/Git/Gitea.php +++ b/src/VCS/Adapter/Git/Gitea.php @@ -71,18 +71,18 @@ public function initializeVariables(string $installationId, string $privateKey, return; } - throw new Exception("accessToken is required for Gitea adapter."); + throw new Exception("accessToken is required for this adapter."); } /** * Generate Access Token * - * Note: This method is required by the Adapter interface but is not used for Gitea. + * Note: This method is required by the Adapter interface but is not used for this adapter. * Gitea uses OAuth2 tokens that are provided directly via initializeVariables(). */ protected function generateAccessToken(string $privateKey, string $appId): void { - // Not applicable for Gitea - OAuth2 tokens are passed directly + // Not applicable for this adapter - OAuth2 tokens are passed directly return; } @@ -224,7 +224,7 @@ public function searchRepositories(string $owner, int $page, int $per_page, stri */ public function getInstallationRepository(string $repositoryName): array { - throw new Exception("getInstallationRepository is not applicable for Gitea - use getRepository() with owner and repo name instead"); + throw new Exception("getInstallationRepository is not applicable for this adapter - use getRepository() with owner and repo name instead"); } public function getRepository(string $owner, string $repositoryName): array @@ -608,7 +608,7 @@ public function getUser(string $username): array public function getOwnerName(string $installationId, ?int $repositoryId = null): string { if ($repositoryId === null || $repositoryId <= 0) { - throw new Exception("repositoryId is required for Gitea"); + throw new Exception("repositoryId is required for this adapter"); } $url = "/repositories/{$repositoryId}"; diff --git a/tests/VCS/Adapter/GiteaTest.php b/tests/VCS/Adapter/GiteaTest.php index 262218b7..078e16fd 100644 --- a/tests/VCS/Adapter/GiteaTest.php +++ b/tests/VCS/Adapter/GiteaTest.php @@ -13,6 +13,7 @@ class GiteaTest extends Base { protected static string $accessToken = ''; protected static string $owner = ''; + protected static string $defaultBranch = 'main'; protected function createVCSAdapter(): Git { @@ -26,7 +27,7 @@ public function setUp(): void } $adapter = new Gitea(new Cache(new None())); - $giteaUrl = System::getEnv('TESTS_GITEA_URL', 'http://gitea:3000') ?? ''; + $giteaUrl = System::getEnv('TESTS_GITEA_URL', 'http://gitea:3000'); $adapter->initializeVariables( installationId: '', @@ -106,7 +107,7 @@ public function testCommentWorkflow(): void try { $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'comment-test', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'comment-test', static::$defaultBranch); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'test.txt', 'test', 'Add test file', 'comment-test'); $pr = $this->vcsAdapter->createPullRequest( @@ -114,7 +115,7 @@ public function testCommentWorkflow(): void $repositoryName, 'Comment Test PR', 'comment-test', - 'main' + static::$defaultBranch ); $prNumber = $pr['number'] ?? 0; @@ -147,7 +148,7 @@ public function testGetComment(): void $this->vcsAdapter->createRepository(static::$owner, $repositoryName, false); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'test-branch', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'test-branch', static::$defaultBranch); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'test.txt', 'test', 'Add test', 'test-branch'); // Create PR @@ -156,7 +157,7 @@ public function testGetComment(): void $repositoryName, 'Test PR', 'test-branch', - 'main' + static::$defaultBranch ); $prNumber = $pr['number'] ?? 0; @@ -212,7 +213,7 @@ public function testGetRepositoryTreeWithSlashInBranchName(): void $this->vcsAdapter->createRepository(static::$owner, $repositoryName, false); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature/test-branch', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature/test-branch', static::$defaultBranch); $tree = $this->vcsAdapter->getRepositoryTree(static::$owner, $repositoryName, 'feature/test-branch'); @@ -296,7 +297,7 @@ public function testGetRepositoryTree(): void $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'src/lib.php', 'vcsAdapter->getRepositoryTree(static::$owner, $repositoryName, 'main', false); + $tree = $this->vcsAdapter->getRepositoryTree(static::$owner, $repositoryName, static::$defaultBranch, false); $this->assertIsArray($tree); $this->assertContains('README.md', $tree); @@ -304,7 +305,7 @@ public function testGetRepositoryTree(): void $this->assertCount(2, $tree); // Only README.md and src folder at root // Test recursive (should show all files including nested) - $treeRecursive = $this->vcsAdapter->getRepositoryTree(static::$owner, $repositoryName, 'main', true); + $treeRecursive = $this->vcsAdapter->getRepositoryTree(static::$owner, $repositoryName, static::$defaultBranch, true); $this->assertIsArray($treeRecursive); $this->assertContains('README.md', $treeRecursive); @@ -358,7 +359,7 @@ public function testGetRepositoryContentWithRef(): void $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'test.txt', 'main branch content'); - $result = $this->vcsAdapter->getRepositoryContent(static::$owner, $repositoryName, 'test.txt', 'main'); + $result = $this->vcsAdapter->getRepositoryContent(static::$owner, $repositoryName, 'test.txt', static::$defaultBranch); $this->assertIsArray($result); $this->assertSame('main branch content', $result['content']); @@ -447,7 +448,7 @@ public function testGetPullRequest(): void $this->vcsAdapter->createRepository(static::$owner, $repositoryName, false); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-branch', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-branch', static::$defaultBranch); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'feature.txt', 'feature content', 'Add feature', 'feature-branch'); $pr = $this->vcsAdapter->createPullRequest( @@ -455,7 +456,7 @@ public function testGetPullRequest(): void $repositoryName, 'Test PR', 'feature-branch', - 'main', + static::$defaultBranch, 'Test PR description' ); @@ -505,7 +506,7 @@ public function testGenerateCloneCommand(): void $command = $this->vcsAdapter->generateCloneCommand( static::$owner, $repositoryName, - 'main', + static::$defaultBranch, \Utopia\VCS\Adapter\Git::CLONE_TYPE_BRANCH, '/tmp/test-clone-' . \uniqid(), '/' @@ -529,7 +530,7 @@ public function testGenerateCloneCommandWithCommitHash(): void try { $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, 'main'); + $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, static::$defaultBranch); $commitHash = $commit['commitHash']; $command = $this->vcsAdapter->generateCloneCommand( @@ -557,7 +558,7 @@ public function testGenerateCloneCommandWithTag(): void // Create initial file and get commit hash $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test Tag'); - $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, 'main'); + $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, static::$defaultBranch); $commitHash = $commit['commitHash']; // Create a tag @@ -593,7 +594,7 @@ public function testGenerateCloneCommandWithInvalidRepository(): void $command = $this->vcsAdapter->generateCloneCommand( 'nonexistent-owner-' . \uniqid(), 'nonexistent-repo-' . \uniqid(), - 'main', + static::$defaultBranch, \Utopia\VCS\Adapter\Git::CLONE_TYPE_BRANCH, $directory, '/' @@ -622,7 +623,7 @@ public function testUpdateComment(): void try { $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'test-branch', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'test-branch', static::$defaultBranch); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'test.txt', 'test', 'Add test', 'test-branch'); // Create PR @@ -631,7 +632,7 @@ public function testUpdateComment(): void $repositoryName, 'Test PR', 'test-branch', - 'main' + static::$defaultBranch ); $prNumber = $pr['number'] ?? 0; @@ -661,7 +662,7 @@ public function testUpdateCommitStatus(): void try { $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, 'main'); + $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, static::$defaultBranch); $commitHash = $commit['commitHash']; $this->vcsAdapter->updateCommitStatus( @@ -730,7 +731,7 @@ public function testGetCommit(): void $customMessage = 'Test commit message'; $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test Commit', $customMessage); - $latestCommit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, 'main'); + $latestCommit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, static::$defaultBranch); $commitHash = $latestCommit['commitHash']; $result = $this->vcsAdapter->getCommit(static::$owner, $repositoryName, $commitHash); @@ -761,7 +762,7 @@ public function testGetLatestCommit(): void $secondMessage = 'Second commit'; $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test', $firstMessage); - $commit1 = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, 'main'); + $commit1 = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, static::$defaultBranch); $this->assertIsArray($commit1); $this->assertArrayHasKey('commitHash', $commit1); @@ -781,7 +782,7 @@ public function testGetLatestCommit(): void $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'test.txt', 'test content', $secondMessage); - $commit2 = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, 'main'); + $commit2 = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, static::$defaultBranch); $this->assertIsArray($commit2); $this->assertNotEmpty($commit2['commitHash']); @@ -875,7 +876,7 @@ public function testGetEventPush(): void $this->assertArrayHasKey('owner', $result); $this->assertArrayHasKey('affectedFiles', $result); - $this->assertSame('main', $result['branch']); + $this->assertSame(static::$defaultBranch, $result['branch']); $this->assertSame('def456', $result['commitHash']); $this->assertSame('test-repo', $result['repositoryName']); $this->assertSame('test-owner', $result['owner']); @@ -910,7 +911,7 @@ public function testGetEventPullRequest(): void ], ], 'base' => [ - 'ref' => 'main', + 'ref' => static::$defaultBranch, 'sha' => 'def456', 'user' => [ 'login' => 'base-owner', @@ -972,7 +973,7 @@ public function testGetEventPullRequestExternal(): void ], ], 'base' => [ - 'ref' => 'main', + 'ref' => static::$defaultBranch, ], 'user' => [ 'avatar_url' => 'http://gitea:3000/avatars/external', @@ -1175,7 +1176,7 @@ public function testGetOwnerName(): void public function testGetOwnerNameWithZeroRepositoryId(): void { $this->expectException(\Exception::class); - $this->expectExceptionMessage('repositoryId is required for Gitea'); + $this->expectExceptionMessage('repositoryId is required for this adapter'); $this->vcsAdapter->getOwnerName('', 0); } @@ -1183,7 +1184,7 @@ public function testGetOwnerNameWithZeroRepositoryId(): void public function testGetOwnerNameWithoutRepositoryId(): void { $this->expectException(\Exception::class); - $this->expectExceptionMessage('repositoryId is required for Gitea'); + $this->expectExceptionMessage('repositoryId is required for this adapter'); $this->vcsAdapter->getOwnerName(''); } @@ -1198,7 +1199,7 @@ public function testGetOwnerNameWithInvalidRepositoryId(): void public function testGetOwnerNameWithNullRepositoryId(): void { $this->expectException(\Exception::class); - $this->expectExceptionMessage('repositoryId is required for Gitea'); + $this->expectExceptionMessage('repositoryId is required for this adapter'); $this->vcsAdapter->getOwnerName('', null); } @@ -1222,9 +1223,9 @@ public function testGetUserWithInvalidUsername(): void public function testGetInstallationRepository(): void { - // This method is not applicable for Gitea + // This method is not applicable for this adapter $this->expectException(\Exception::class); - $this->expectExceptionMessage('not applicable for Gitea'); + $this->expectExceptionMessage('not applicable for this adapter'); $this->vcsAdapter->getInstallationRepository('any-repo-name'); } @@ -1235,7 +1236,7 @@ public function testGetPullRequestFromBranch(): void $this->vcsAdapter->createRepository(static::$owner, $repositoryName, false); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'my-feature', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'my-feature', static::$defaultBranch); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'feature.txt', 'content', 'Add feature', 'my-feature'); // Create PR @@ -1244,7 +1245,7 @@ public function testGetPullRequestFromBranch(): void $repositoryName, 'Feature PR', 'my-feature', - 'main' + static::$defaultBranch ); $this->assertArrayHasKey('number', $pr); @@ -1268,7 +1269,7 @@ public function testGetPullRequestFromBranchNoPR(): void $this->vcsAdapter->createRepository(static::$owner, $repositoryName, false); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'lonely-branch', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'lonely-branch', static::$defaultBranch); // Don't create a PR - just test the method $result = $this->vcsAdapter->getPullRequestFromBranch(static::$owner, $repositoryName, 'lonely-branch'); @@ -1286,7 +1287,7 @@ public function testCreateComment(): void try { $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'test-branch', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'test-branch', static::$defaultBranch); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'test.txt', 'test', 'Add test', 'test-branch'); // Create PR @@ -1295,7 +1296,7 @@ public function testCreateComment(): void $repositoryName, 'Test PR', 'test-branch', - 'main' + static::$defaultBranch ); $prNumber = $pr['number'] ?? 0; @@ -1344,7 +1345,7 @@ public function testCreateFileOnBranch(): void try { $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Main'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature', static::$defaultBranch); // Create file on specific branch $result = $this->vcsAdapter->createFile( @@ -1381,8 +1382,8 @@ public function testListBranches(): void $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); // Create additional branches - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-1', 'main'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-2', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-1', static::$defaultBranch); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-2', static::$defaultBranch); $branches = []; $maxAttempts = 10; @@ -1398,7 +1399,7 @@ public function testListBranches(): void $this->assertIsArray($branches); $this->assertNotEmpty($branches); - $this->assertContains('main', $branches); + $this->assertContains(static::$defaultBranch, $branches); $this->assertContains('feature-1', $branches); $this->assertContains('feature-2', $branches); $this->assertGreaterThanOrEqual(3, count($branches)); @@ -1415,7 +1416,7 @@ public function testCreateTag(): void try { $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, 'main'); + $commit = $this->vcsAdapter->getLatestCommit(static::$owner, $repositoryName, static::$defaultBranch); $commitHash = $commit['commitHash']; $result = $this->vcsAdapter->createTag( @@ -1479,7 +1480,7 @@ public function testWebhookPushEvent(): void $this->vcsAdapter->createRepository(static::$owner, $repositoryName, false); try { - $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000') ?? ''; + $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000'); $this->deleteLastWebhookRequest(); $this->vcsAdapter->createWebhook(static::$owner, $repositoryName, $catcherUrl . '/webhook', $secret); @@ -1513,7 +1514,7 @@ public function testWebhookPushEvent(): void $event = $this->vcsAdapter->getEvent('push', $payload); $this->assertIsArray($event); - $this->assertSame('main', $event['branch']); + $this->assertSame(static::$defaultBranch, $event['branch']); $this->assertSame($repositoryName, $event['repositoryName']); $this->assertSame(static::$owner, $event['owner']); $this->assertNotEmpty($event['commitHash']); @@ -1533,10 +1534,10 @@ public function testWebhookPullRequestEvent(): void // Create all files BEFORE configuring webhook // so those push events don't pollute the catcher $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'README.md', '# Test'); - $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-branch', 'main'); + $this->vcsAdapter->createBranch(static::$owner, $repositoryName, 'feature-branch', static::$defaultBranch); $this->vcsAdapter->createFile(static::$owner, $repositoryName, 'feature.txt', 'content', 'Add feature', 'feature-branch'); - $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000') ?? ''; + $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000'); $this->vcsAdapter->createWebhook(static::$owner, $repositoryName, $catcherUrl . '/webhook', $secret); // Clear after setup so only PR event will arrive @@ -1548,7 +1549,7 @@ public function testWebhookPullRequestEvent(): void $repositoryName, 'Test Webhook PR', 'feature-branch', - 'main' + static::$defaultBranch ); // Wait for pull_request webhook to arrive automatically diff --git a/tests/VCS/Base.php b/tests/VCS/Base.php index 3ad42889..026da39c 100644 --- a/tests/VCS/Base.php +++ b/tests/VCS/Base.php @@ -37,7 +37,7 @@ abstract public function testGetRepositoryTree(): void; /** @return array */ protected function getLastWebhookRequest(): array { - $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000') ?? ''; + $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000'); $client = new Client(); $response = $client->fetch( @@ -78,7 +78,7 @@ protected function assertEventually(callable $probe, int $timeoutMs = 15000, int protected function deleteLastWebhookRequest(): void { - $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000') ?? ''; + $catcherUrl = System::getEnv('TESTS_GITEA_REQUEST_CATCHER_URL', 'http://request-catcher:5000'); $client = new Client(); $client->fetch(