refactoring (#116)

- refactoring architecture
- fix incomplete ssh logs
- code editor for scripts in the app
- remove Jobs and SSHCommands
This commit is contained in:
Saeed Vaziry
2024-03-14 20:03:43 +01:00
committed by GitHub
parent cee4a70c3c
commit 428140b931
472 changed files with 24110 additions and 8159 deletions

View File

@ -4,11 +4,9 @@
use App\Enums\SslStatus;
use App\Enums\SslType;
use App\Jobs\Ssl\Deploy;
use App\Jobs\Ssl\Remove;
use App\Facades\SSH;
use App\Models\Ssl;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Bus;
use Tests\TestCase;
class SslTest extends TestCase
@ -45,7 +43,7 @@ public function test_see_ssls_list_with_no_ssls()
public function test_create_ssl()
{
Bus::fake();
SSH::fake('Successfully received certificate');
$this->actingAs($this->user);
@ -59,15 +57,13 @@ public function test_create_ssl()
$this->assertDatabaseHas('ssls', [
'site_id' => $this->site->id,
'type' => SslType::LETSENCRYPT,
'status' => SslStatus::CREATING,
'status' => SslStatus::CREATED,
]);
Bus::assertDispatched(Deploy::class);
}
public function test_delete_ssl()
{
Bus::fake();
SSH::fake();
$this->actingAs($this->user);
@ -81,11 +77,8 @@ public function test_delete_ssl()
'ssl' => $ssl,
]))->assertRedirect();
$this->assertDatabaseHas('ssls', [
$this->assertDatabaseMissing('ssls', [
'id' => $ssl->id,
'status' => SslStatus::DELETING,
]);
Bus::assertDispatched(Remove::class);
}
}