fixed missing features
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests\Feature\Models;
|
||||
|
||||
use App\Actions\Git\Data\GitRepository;
|
||||
use App\Actions\Git\GitProviderKey;
|
||||
use App\Models\RepositoryConnection;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -33,4 +34,27 @@ class RepositoryConnectionTest extends TestCase
|
||||
$this->assertTrue($repositoryConnection->project()->exists());
|
||||
$this->assertTrue($repositoryConnection->project->is($repositoryConnection->fresh()->project));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure repository connections can be used as Git provider repository data.
|
||||
*/
|
||||
public function test_repository_connections_convert_to_git_repository_data(): void
|
||||
{
|
||||
$repositoryConnection = RepositoryConnection::factory()->create([
|
||||
'base_url' => 'https://git.example.test',
|
||||
'owner_name' => 'core-team',
|
||||
'provider_repository_id' => '501',
|
||||
'repository_full_name' => 'core-team/kanbangit',
|
||||
'repository_name' => 'kanbangit',
|
||||
'repository_url' => 'https://git.example.test/core-team/kanbangit',
|
||||
]);
|
||||
|
||||
$repository = $repositoryConnection->toGitRepository();
|
||||
|
||||
$this->assertInstanceOf(GitRepository::class, $repository);
|
||||
$this->assertSame('https://git.example.test', $repository->baseUrl);
|
||||
$this->assertSame('core-team', $repository->owner);
|
||||
$this->assertSame('kanbangit', $repository->name);
|
||||
$this->assertSame('core-team/kanbangit', $repository->fullName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user