Skip to content

Commit 5b37c77

Browse files
committed
Fix tests
1 parent ea08c5a commit 5b37c77

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/VCS/Adapter/Git/GitHub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ public function getUser(string $username): array
637637
* Get owner name of the GitHub installation
638638
*
639639
* @param string $installationId GitHub App installation ID
640-
* @param int|null $repositoryId Not used by GitHub (parameter exists for Gitea compatibility)
640+
* @param int|null $repositoryId Not used by GitHub (parameter exists for this adapter compatibility)
641641
* @return string Owner login/username
642642
*/
643643
public function getOwnerName(string $installationId, ?int $repositoryId = null): string

src/VCS/Adapter/Git/Gitea.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ public function initializeVariables(string $installationId, string $privateKey,
7777
/**
7878
* Generate Access Token
7979
*
80-
* Note: This method is required by the Adapter interface but is not used for Gitea.
80+
* Note: This method is required by the Adapter interface but is not used for this adapter.
8181
* Gitea uses OAuth2 tokens that are provided directly via initializeVariables().
8282
*/
8383
protected function generateAccessToken(string $privateKey, string $appId): void
8484
{
85-
// Not applicable for Gitea - OAuth2 tokens are passed directly
85+
// Not applicable for this adapter - OAuth2 tokens are passed directly
8686
return;
8787
}
8888

@@ -224,7 +224,7 @@ public function searchRepositories(string $owner, int $page, int $per_page, stri
224224
*/
225225
public function getInstallationRepository(string $repositoryName): array
226226
{
227-
throw new Exception("getInstallationRepository is not applicable for Gitea - use getRepository() with owner and repo name instead");
227+
throw new Exception("getInstallationRepository is not applicable for this adapter - use getRepository() with owner and repo name instead");
228228
}
229229

230230
public function getRepository(string $owner, string $repositoryName): array

tests/VCS/Adapter/GiteaTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,15 +1176,15 @@ public function testGetOwnerName(): void
11761176
public function testGetOwnerNameWithZeroRepositoryId(): void
11771177
{
11781178
$this->expectException(\Exception::class);
1179-
$this->expectExceptionMessage('repositoryId is required for Gitea');
1179+
$this->expectExceptionMessage('repositoryId is required for this adapter');
11801180

11811181
$this->vcsAdapter->getOwnerName('', 0);
11821182
}
11831183

11841184
public function testGetOwnerNameWithoutRepositoryId(): void
11851185
{
11861186
$this->expectException(\Exception::class);
1187-
$this->expectExceptionMessage('repositoryId is required for Gitea');
1187+
$this->expectExceptionMessage('repositoryId is required for this adapter');
11881188

11891189
$this->vcsAdapter->getOwnerName('');
11901190
}
@@ -1199,7 +1199,7 @@ public function testGetOwnerNameWithInvalidRepositoryId(): void
11991199
public function testGetOwnerNameWithNullRepositoryId(): void
12001200
{
12011201
$this->expectException(\Exception::class);
1202-
$this->expectExceptionMessage('repositoryId is required for Gitea');
1202+
$this->expectExceptionMessage('repositoryId is required for this adapter');
12031203

12041204
$this->vcsAdapter->getOwnerName('', null);
12051205
}
@@ -1223,9 +1223,9 @@ public function testGetUserWithInvalidUsername(): void
12231223

12241224
public function testGetInstallationRepository(): void
12251225
{
1226-
// This method is not applicable for Gitea
1226+
// This method is not applicable for this adapter
12271227
$this->expectException(\Exception::class);
1228-
$this->expectExceptionMessage('not applicable for Gitea');
1228+
$this->expectExceptionMessage('not applicable for this adapter');
12291229

12301230
$this->vcsAdapter->getInstallationRepository('any-repo-name');
12311231
}

0 commit comments

Comments
 (0)