mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 06:26:16 +00:00
#591 - tests
This commit is contained in:
@ -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 [
|
||||
|
Reference in New Issue
Block a user