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

@ -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 [