fix bitbucket (#119)

Fix Bitbucket API errors
This commit is contained in:
Saeed Vaziry
2024-03-17 11:36:04 +01:00
committed by GitHub
parent f0c4fc4812
commit b07ae470f9
10 changed files with 167 additions and 45 deletions

View File

@ -14,17 +14,16 @@ class SourceControlsTest extends TestCase
/**
* @dataProvider data
*/
public function test_connect_provider(string $provider, ?string $customUrl): void
public function test_connect_provider(string $provider, ?string $customUrl, array $input): void
{
$this->actingAs($this->user);
Http::fake();
$input = [
$input = array_merge([
'name' => 'test',
'provider' => $provider,
'token' => 'token',
];
], $input);
if ($customUrl !== null) {
$input['url'] = $customUrl;
@ -89,10 +88,10 @@ public function test_cannot_delete_provider(string $provider): void
public static function data(): array
{
return [
['github', null],
['gitlab', null],
['gitlab', 'https://git.example.com/'],
['bitbucket', null],
['github', null, ['token' => 'test']],
['gitlab', null, ['token' => 'test']],
['gitlab', 'https://git.example.com/', ['token' => 'test']],
['bitbucket', null, ['username' => 'test', 'password' => 'test']],
];
}
}