This commit is contained in:
Saeed Vaziry
2025-06-04 19:04:02 +02:00
parent 35894003f5
commit f8f8d57fe2
31 changed files with 165 additions and 171 deletions

View File

@ -5,6 +5,7 @@
use App\Models\SourceControl;
use App\SourceControlProviders\Gitlab;
use Illuminate\Foundation\Testing\RefreshDatabase;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
class GitlabTest extends TestCase
@ -36,9 +37,7 @@ public function test_default_gitlab_repo_url(): void
$this->assertSame('git@gitlab.com-TEST_KEY:test/repo.git', $gitlab->fullRepoUrl($repo, $key));
}
/**
* @dataProvider customUrlData
*/
#[DataProvider('customUrlData')]
public function test_custom_url(string $url, string $expected): void
{
$sourceControlModel = SourceControl::factory()
@ -50,9 +49,7 @@ public function test_custom_url(string $url, string $expected): void
$this->assertSame($expected, $gitlab->getApiUrl());
}
/**
* @dataProvider customRepoUrlData
*/
#[DataProvider('customRepoUrlData')]
public function test_custom_full_repository_url(string $url, string $expected): void
{
$repo = 'test/repo';
@ -67,6 +64,9 @@ public function test_custom_full_repository_url(string $url, string $expected):
$this->assertSame($expected, $gitlab->fullRepoUrl($repo, $key));
}
/**
* @return array<int, array<int, string>>
*/
public static function customRepoUrlData(): array
{
return [
@ -76,6 +76,9 @@ public static function customRepoUrlData(): array
];
}
/**
* @return array<int, array<int, string>>
*/
public static function customUrlData(): array
{
return [