mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
#591 - tests
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SourceControlsTest extends TestCase
|
||||
@ -13,8 +14,9 @@ class SourceControlsTest extends TestCase
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
* @param array<string, mixed> $input
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_connect_provider(string $provider, array $input): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -39,6 +41,7 @@ public function test_connect_provider(string $provider, array $input): void
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_delete_provider(string $provider): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -60,6 +63,7 @@ public function test_delete_provider(string $provider): void
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_cannot_delete_provider(string $provider): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -90,7 +94,10 @@ public function test_cannot_delete_provider(string $provider): void
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*
|
||||
* @param array<string, mixed> $input
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_edit_source_control(string $provider, array $input): void
|
||||
{
|
||||
Http::fake();
|
||||
@ -124,6 +131,9 @@ public function test_edit_source_control(string $provider, array $input): void
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array<int, mixed>>
|
||||
*/
|
||||
public static function data(): array
|
||||
{
|
||||
return [
|
||||
|
Reference in New Issue
Block a user