Switch Gitea connection validation to repository access
This commit is contained in:
@@ -15,6 +15,27 @@ class GiteaProviderTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* Ensure the provider can verify repository read access with minimal payload.
|
||||
*/
|
||||
public function test_provider_can_verify_repository_read_access(): void
|
||||
{
|
||||
Http::preventStrayRequests();
|
||||
Http::fake([
|
||||
'https://git.example.test/api/v1/user/repos*' => Http::response([]),
|
||||
]);
|
||||
|
||||
app(GiteaProviderClient::class)->verifyRepositoryAccess(
|
||||
'https://git.example.test',
|
||||
'repo-token',
|
||||
);
|
||||
|
||||
Http::assertSent(function ($request): bool {
|
||||
return $request->url() === 'https://git.example.test/api/v1/user/repos?limit=1&page=1'
|
||||
&& $request->hasHeader('Authorization', 'token repo-token');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure the provider authenticates against the Gitea user endpoint.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user