code style fix

add command tests
This commit is contained in:
Saeed Vaziry
2023-09-02 16:41:42 +02:00
parent 71f9dabc24
commit e1eb42059f
135 changed files with 1859 additions and 135 deletions

View File

@ -23,7 +23,7 @@ public function test_visit_application()
$this->get(
route('servers.sites.show', [
'server' => $this->server,
'site' => $this->site
'site' => $this->site,
])
)
->assertOk()
@ -44,7 +44,7 @@ public function test_update_deployment_script()
$this->assertDatabaseHas('deployment_scripts', [
'site_id' => $this->site->id,
'content' => 'some script'
'content' => 'some script',
]);
$this->site->refresh();

View File

@ -58,7 +58,7 @@ public function test_create_cronjob()
'command' => 'ls -la',
'user' => 'vito',
'frequency' => '* * * * *',
'status' => CronjobStatus::CREATING
'status' => CronjobStatus::CREATING,
]);
}
}

View File

@ -32,7 +32,7 @@ public function test_create_backup(): void
$storage = StorageProvider::factory()->create([
'user_id' => $this->user->id,
'provider' => \App\Enums\StorageProvider::DROPBOX
'provider' => \App\Enums\StorageProvider::DROPBOX,
]);
Livewire::test(DatabaseBackups::class, ['server' => $this->server])
@ -60,7 +60,7 @@ public function test_see_backups_list(): void
$storage = StorageProvider::factory()->create([
'user_id' => $this->user->id,
'provider' => \App\Enums\StorageProvider::DROPBOX
'provider' => \App\Enums\StorageProvider::DROPBOX,
]);
$backup = Backup::factory()->create([
@ -85,7 +85,7 @@ public function test_delete_database(): void
$storage = StorageProvider::factory()->create([
'user_id' => $this->user->id,
'provider' => \App\Enums\StorageProvider::DROPBOX
'provider' => \App\Enums\StorageProvider::DROPBOX,
]);
$backup = Backup::factory()->create([

View File

@ -35,7 +35,7 @@ public function test_create_firewall_rule(): void
Bus::assertDispatched(AddToServer::class);
$this->assertDatabaseHas('firewall_rules', [
'port' => '1234'
'port' => '1234',
]);
}
@ -44,7 +44,7 @@ public function test_see_firewall_rules(): void
$this->actingAs($this->user);
$rule = FirewallRule::factory()->create([
'server_id' => $this->server->id
'server_id' => $this->server->id,
]);
Livewire::test(FirewallRulesList::class, ['server' => $this->server])
@ -61,7 +61,7 @@ public function test_delete_firewall_rule(): void
$this->actingAs($this->user);
$rule = FirewallRule::factory()->create([
'server_id' => $this->server->id
'server_id' => $this->server->id,
]);
Livewire::test(FirewallRulesList::class, ['server' => $this->server])
@ -73,7 +73,7 @@ public function test_delete_firewall_rule(): void
$this->assertDatabaseHas('firewall_rules', [
'id' => $rule->id,
'status' => FirewallRuleStatus::DELETING
'status' => FirewallRuleStatus::DELETING,
]);
}
}

View File

@ -59,7 +59,7 @@ public function test_change_default_php_cli(): void
],
'name' => 'php',
'version' => '8.1',
'status' => ServiceStatus::READY
'status' => ServiceStatus::READY,
]);
Livewire::test(DefaultCli::class, ['server' => $this->server])

View File

@ -63,7 +63,7 @@ public function test_create_queue()
'auto_start' => 1,
'auto_restart' => 1,
'numprocs' => 1,
'status' => QueueStatus::CREATING
'status' => QueueStatus::CREATING,
]);
}
}

View File

@ -56,7 +56,7 @@ public function test_delete_ssh_key()
$this->assertDatabaseHas('server_ssh_keys', [
'server_id' => $this->server->id,
'ssh_key_id' => $sshKey->id,
'status' => SshKeyStatus::DELETING
'status' => SshKeyStatus::DELETING,
]);
Bus::assertDispatched(DeleteSshKeyFromServer::class);
@ -77,7 +77,7 @@ public function test_add_new_ssh_key()
$this->assertDatabaseHas('server_ssh_keys', [
'server_id' => $this->server->id,
'status' => SshKeyStatus::ADDING
'status' => SshKeyStatus::ADDING,
]);
Bus::assertDispatched(DeploySshKeyToServer::class);
@ -103,7 +103,7 @@ public function test_add_existing_key()
$this->assertDatabaseHas('server_ssh_keys', [
'server_id' => $this->server->id,
'status' => SshKeyStatus::ADDING
'status' => SshKeyStatus::ADDING,
]);
Bus::assertDispatched(DeploySshKeyToServer::class);

View File

@ -25,7 +25,7 @@ public function test_see_services_list(): void
'supervisor',
'redis',
'ufw',
'php'
'php',
]);
}

View File

@ -2,10 +2,7 @@
namespace Tests\Feature\Http;
use App\Http\Livewire\SourceControls\Bitbucket;
use App\Http\Livewire\SourceControls\Connect;
use App\Http\Livewire\SourceControls\Github;
use App\Http\Livewire\SourceControls\Gitlab;
use App\Http\Livewire\SourceControls\SourceControlsList;
use App\Models\SourceControl;
use Illuminate\Foundation\Testing\RefreshDatabase;
@ -48,7 +45,7 @@ public function test_delete_provider(string $provider): void
/** @var SourceControl $sourceControl */
$sourceControl = SourceControl::factory()->create([
'provider' => $provider,
'profile' => 'test'
'profile' => 'test',
]);
Livewire::test(SourceControlsList::class)

View File

@ -3,8 +3,8 @@
namespace Tests\Feature\Http;
use App\Enums\StorageProvider;
use App\Http\Livewire\StorageProviders\ProvidersList;
use App\Http\Livewire\StorageProviders\ConnectProvider;
use App\Http\Livewire\StorageProviders\ProvidersList;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Livewire\Livewire;
@ -39,7 +39,7 @@ public function test_see_providers_list(): void
$provider = \App\Models\StorageProvider::factory()->create([
'user_id' => $this->user->id,
'provider' => StorageProvider::DROPBOX
'provider' => StorageProvider::DROPBOX,
]);
Livewire::test(ProvidersList::class)