mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-07 08:52:35 +00:00
#591 - tests
This commit is contained in:
@ -13,7 +13,7 @@ class CronjobTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_see_cronjobs_list()
|
||||
public function test_see_cronjobs_list(): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
|
||||
@ -33,7 +33,7 @@ public function test_see_cronjobs_list()
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_create_cronjob()
|
||||
public function test_create_cronjob(): void
|
||||
{
|
||||
SSH::fake();
|
||||
|
||||
@ -56,7 +56,7 @@ public function test_create_cronjob()
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_delete_cronjob()
|
||||
public function test_delete_cronjob(): void
|
||||
{
|
||||
SSH::fake();
|
||||
|
||||
|
@ -80,7 +80,7 @@ public function test_cannot_delete_last_project(): void
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
|
||||
$this->json('DELETE', "/api/projects/{$this->user->currentProject->id}")
|
||||
->assertJsonValidationErrorFor('project');
|
||||
->assertJsonValidationErrorFor('name');
|
||||
|
||||
$this->assertDatabaseHas('projects', [
|
||||
'id' => $this->user->currentProject->id,
|
||||
|
@ -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 [
|
||||
|
@ -6,6 +6,7 @@
|
||||
use App\Facades\SSH;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ServicesTest extends TestCase
|
||||
@ -57,9 +58,7 @@ public function test_show_service(): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_manage_service(string $action): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -94,6 +93,10 @@ public function test_uninstall_service(): void
|
||||
]))
|
||||
->assertSuccessful()
|
||||
->assertNoContent();
|
||||
|
||||
$this->assertDatabaseMissing('services', [
|
||||
'id' => $service->id,
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_cannot_uninstall_service_because_it_is_being_used(): void
|
||||
@ -112,6 +115,9 @@ public function test_cannot_uninstall_service_because_it_is_being_used(): void
|
||||
->assertJsonValidationErrorFor('service');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array<string>>
|
||||
*/
|
||||
public static function data(): array
|
||||
{
|
||||
return [
|
||||
|
@ -11,6 +11,7 @@
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
use Tests\Traits\PrepareLoadBalancer;
|
||||
|
||||
@ -27,8 +28,9 @@ protected function setUp(): void
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider create_data
|
||||
* @param array<string, mixed> $inputs
|
||||
*/
|
||||
#[DataProvider('create_data')]
|
||||
public function test_create_site(array $inputs): void
|
||||
{
|
||||
SSH::fake();
|
||||
@ -383,10 +385,11 @@ public function test_update_env(): void
|
||||
->assertJsonFragment([
|
||||
'domain' => $site->domain,
|
||||
]);
|
||||
|
||||
SSH::assertExecuted('edit-file');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array<array<string, mixed>>>
|
||||
*/
|
||||
public static function create_data(): array
|
||||
{
|
||||
return \Tests\Feature\SitesTest::create_data();
|
||||
|
@ -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 [
|
||||
|
@ -10,6 +10,7 @@
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class StorageProvidersTest extends TestCase
|
||||
@ -17,8 +18,9 @@ class StorageProvidersTest extends TestCase
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* @dataProvider createData
|
||||
* @param array<string, mixed> $input
|
||||
*/
|
||||
#[DataProvider('createData')]
|
||||
public function test_create(array $input): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -106,7 +108,7 @@ public function test_cannot_delete_provider(): void
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO: complete FTP tests
|
||||
* @return array<int, array<int, array<string, mixed>>>
|
||||
*/
|
||||
public static function createData(): array
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Inertia\Testing\AssertableInertia;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ApplicationTest extends TestCase
|
||||
@ -153,9 +154,8 @@ public function test_update_env_file(): void
|
||||
/**
|
||||
* @param array<string, mixed> $webhook
|
||||
* @param array<string, mixed> $payload
|
||||
*
|
||||
* @dataProvider hookData
|
||||
*/
|
||||
#[DataProvider('hookData')]
|
||||
public function test_git_hook_deployment(string $provider, array $webhook, string $url, array $payload, bool $skip): void
|
||||
{
|
||||
SSH::fake();
|
||||
|
@ -143,7 +143,7 @@ public function test_cannot_create_cronjob_for_user_on_another_server(): void
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_create_custom_cronjob()
|
||||
public function test_create_custom_cronjob(): void
|
||||
{
|
||||
SSH::fake();
|
||||
|
||||
@ -169,7 +169,7 @@ public function test_create_custom_cronjob()
|
||||
SSH::assertExecutedContains('sudo -u vito crontab -l');
|
||||
}
|
||||
|
||||
public function test_enable_cronjob()
|
||||
public function test_enable_cronjob(): void
|
||||
{
|
||||
SSH::fake();
|
||||
|
||||
|
@ -13,17 +13,14 @@
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use JsonException;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DatabaseBackupTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_create_backup(string $db): void
|
||||
{
|
||||
SSH::fake();
|
||||
@ -156,11 +153,7 @@ public function test_update_backup(): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_delete_backup(string $db): void
|
||||
{
|
||||
$this->setupDatabase($db);
|
||||
@ -190,11 +183,7 @@ public function test_delete_backup(string $db): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_restore_backup(string $db): void
|
||||
{
|
||||
Http::fake();
|
||||
@ -247,6 +236,9 @@ private function setupDatabase(string $database): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, array<int, string>>
|
||||
*/
|
||||
public static function data(): array
|
||||
{
|
||||
return [
|
||||
|
@ -7,6 +7,7 @@
|
||||
use App\Facades\SSH;
|
||||
use App\Models\Service;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PHPTest extends TestCase
|
||||
@ -64,9 +65,7 @@ public function test_install_extension(): void
|
||||
$this->assertContains('gmp', $php->refresh()->type_data['extensions']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider php_ini_data
|
||||
*/
|
||||
#[DataProvider('php_ini_data')]
|
||||
public function test_get_php_ini(string $version, string $type): void
|
||||
{
|
||||
SSH::fake('[PHP ini]');
|
||||
|
@ -7,6 +7,7 @@
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Inertia\Testing\AssertableInertia;
|
||||
use JsonException;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ServerProvidersTest extends TestCase
|
||||
@ -16,10 +17,9 @@ class ServerProvidersTest extends TestCase
|
||||
/**
|
||||
* @param array<string, mixed> $input
|
||||
*
|
||||
* @dataProvider data
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_connect_provider(string $provider, array $input): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -45,9 +45,8 @@ public function test_connect_provider(string $provider, array $input): void
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $input
|
||||
*
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_cannot_connect_to_provider(string $provider, array $input): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -86,10 +85,9 @@ public function test_see_providers_list(): void
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_delete_provider(string $provider): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -108,9 +106,7 @@ public function test_delete_provider(string $provider): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_cannot_delete_provider(string $provider): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
@ -9,6 +9,7 @@
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Inertia\Testing\AssertableInertia;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ServicesTest extends TestCase
|
||||
@ -26,9 +27,7 @@ public function test_see_services_list(): void
|
||||
->assertInertia(fn (AssertableInertia $page) => $page->component('services/index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_restart_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -50,9 +49,7 @@ public function test_restart_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::READY, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_failed_to_restart_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -72,9 +69,7 @@ public function test_failed_to_restart_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::FAILED, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_stop_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -94,9 +89,7 @@ public function test_stop_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::STOPPED, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_failed_to_stop_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -116,9 +109,7 @@ public function test_failed_to_stop_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::FAILED, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_start_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -140,9 +131,7 @@ public function test_start_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::READY, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_failed_to_start_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -162,9 +151,7 @@ public function test_failed_to_start_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::FAILED, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_enable_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -186,9 +173,7 @@ public function test_enable_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::READY, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_failed_to_enable_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -208,9 +193,7 @@ public function test_failed_to_enable_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::FAILED, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_disable_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -230,9 +213,7 @@ public function test_disable_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::DISABLED, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_failed_to_disable_service(string $name): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -252,9 +233,7 @@ public function test_failed_to_disable_service(string $name): void
|
||||
$this->assertEquals(ServiceStatus::FAILED, $service->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider installData
|
||||
*/
|
||||
#[DataProvider('installData')]
|
||||
public function test_install_service(string $name, string $type, string $version): void
|
||||
{
|
||||
Http::fake([
|
||||
@ -357,11 +336,6 @@ public static function installData(): array
|
||||
'database',
|
||||
'16',
|
||||
],
|
||||
[
|
||||
'vito-agent',
|
||||
'monitoring',
|
||||
'latest',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Inertia\Testing\AssertableInertia;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SitesTest extends TestCase
|
||||
@ -19,9 +20,8 @@ class SitesTest extends TestCase
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $inputs
|
||||
*
|
||||
* @dataProvider create_data
|
||||
*/
|
||||
#[DataProvider('create_data')]
|
||||
public function test_create_site(array $inputs): void
|
||||
{
|
||||
SSH::fake();
|
||||
@ -55,9 +55,8 @@ public function test_create_site(array $inputs): void
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $inputs
|
||||
*
|
||||
* @dataProvider failure_create_data
|
||||
*/
|
||||
#[DataProvider('failure_create_data')]
|
||||
public function test_isolated_user_failure(array $inputs): void
|
||||
{
|
||||
SSH::fake();
|
||||
@ -67,9 +66,7 @@ public function test_isolated_user_failure(array $inputs): void
|
||||
->assertSessionHasErrors();
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider create_failure_data
|
||||
*/
|
||||
#[DataProvider('create_failure_data')]
|
||||
public function test_create_site_failed_due_to_source_control(int $status): void
|
||||
{
|
||||
$inputs = [
|
||||
@ -275,7 +272,7 @@ public function test_change_branch(): void
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array<string, mixed>>
|
||||
* @return array<array<int, mixed>>
|
||||
*/
|
||||
public static function failure_create_data(): array
|
||||
{
|
||||
|
@ -5,6 +5,7 @@
|
||||
use App\Models\SourceControl;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SourceControlsTest extends TestCase
|
||||
@ -13,9 +14,8 @@ class SourceControlsTest extends TestCase
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $input
|
||||
*
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_connect_provider(string $provider, ?string $customUrl, array $input): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -53,9 +53,7 @@ public function test_connect_provider(string $provider, ?string $customUrl, arra
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_delete_provider(string $provider): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -75,9 +73,7 @@ public function test_delete_provider(string $provider): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_cannot_delete_provider(string $provider): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -104,9 +100,8 @@ public function test_cannot_delete_provider(string $provider): void
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $input
|
||||
*
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_edit_source_control(string $provider, ?string $url, array $input): void
|
||||
{
|
||||
Http::fake();
|
||||
|
@ -5,6 +5,7 @@
|
||||
use App\Models\SshKey;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Inertia\Testing\AssertableInertia;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SshKeysTest extends TestCase
|
||||
@ -56,9 +57,8 @@ public function test_delete_key(): void
|
||||
|
||||
/**
|
||||
* @param array<string, string> $postBody
|
||||
*
|
||||
* @dataProvider ssh_key_data_provider
|
||||
*/
|
||||
#[DataProvider('ssh_key_data_provider')]
|
||||
public function test_create_ssh_key_handles_invalid_or_partial_keys(array $postBody, bool $expectedToSucceed): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
@ -10,6 +10,7 @@
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Inertia\Testing\AssertableInertia;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class StorageProvidersTest extends TestCase
|
||||
@ -18,9 +19,8 @@ class StorageProvidersTest extends TestCase
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $input
|
||||
*
|
||||
* @dataProvider createData
|
||||
*/
|
||||
#[DataProvider('createData')]
|
||||
public function test_create(array $input): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
@ -104,8 +104,6 @@ public function test_cannot_delete_provider(): void
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO: complete FTP tests
|
||||
*
|
||||
* @return array<int, mixed>
|
||||
*/
|
||||
public static function createData(): array
|
||||
|
Reference in New Issue
Block a user