update vhost and bug fix (#87)

This commit is contained in:
Saeed Vaziry
2024-01-05 22:07:45 +01:00
committed by GitHub
parent f120a570e8
commit f06b8f7d20
9 changed files with 140 additions and 4 deletions

View File

@ -5,11 +5,13 @@
use App\Enums\SiteStatus;
use App\Enums\SiteType;
use App\Enums\SourceControl;
use App\Facades\SSH;
use App\Http\Livewire\Sites\ChangePhpVersion;
use App\Http\Livewire\Sites\CreateSite;
use App\Http\Livewire\Sites\DeleteSite;
use App\Http\Livewire\Sites\SitesList;
use App\Http\Livewire\Sites\UpdateSourceControlProvider;
use App\Http\Livewire\Sites\UpdateVHost;
use App\Jobs\Site\CreateVHost;
use App\Models\Site;
use Illuminate\Foundation\Testing\RefreshDatabase;
@ -107,6 +109,22 @@ public function test_change_php_version(): void
Bus::assertDispatched(\App\Jobs\Site\ChangePHPVersion::class);
}
public function test_update_v_host(): void
{
SSH::fake();
$this->actingAs($this->user);
$site = Site::factory()->create([
'server_id' => $this->server->id,
]);
Livewire::test(UpdateVHost::class, ['site' => $site])
->set('vHost', 'test-vhost')
->call('update')
->assertSuccessful();
}
public function test_update_source_control(): void
{
$this->actingAs($this->user);