mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 06:26:16 +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 ServerProvidersTest extends TestCase
|
||||
@ -13,8 +14,9 @@ class ServerProvidersTest 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']);
|
||||
@ -40,8 +42,9 @@ public function test_connect_provider(string $provider, array $input): void
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
* @param array<string, mixed> $input
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_cannot_connect_to_provider(string $provider, array $input): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -82,9 +85,7 @@ public function test_see_providers_list(): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_delete_provider(string $provider): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -102,9 +103,7 @@ public function test_delete_provider(string $provider): void
|
||||
->assertNoContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_cannot_delete_provider(string $provider): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -128,6 +127,9 @@ public function test_cannot_delete_provider(string $provider): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array<int, mixed>>
|
||||
*/
|
||||
public static function data(): array
|
||||
{
|
||||
return [
|
||||
|
Reference in New Issue
Block a user