mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
@ -2,12 +2,9 @@
|
||||
|
||||
namespace Tests\Feature\API;
|
||||
|
||||
use App\Enums\Database;
|
||||
use App\Enums\OperatingSystem;
|
||||
use App\Enums\ServerProvider;
|
||||
use App\Enums\ServerType;
|
||||
use App\Enums\Webserver;
|
||||
use App\Facades\SSH;
|
||||
use App\ServerProviders\Custom;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Tests\TestCase;
|
||||
@ -52,44 +49,15 @@ public function test_create_server(): void
|
||||
$this->json('POST', route('api.projects.servers.create', [
|
||||
'project' => $this->user->current_project_id,
|
||||
]), [
|
||||
'provider' => ServerProvider::CUSTOM,
|
||||
'provider' => Custom::id(),
|
||||
'name' => 'test',
|
||||
'ip' => '1.1.1.1',
|
||||
'port' => '22',
|
||||
'os' => OperatingSystem::UBUNTU22,
|
||||
'webserver' => Webserver::NGINX,
|
||||
'database' => Database::MYSQL80,
|
||||
'php' => '8.2',
|
||||
])
|
||||
->assertSuccessful()
|
||||
->assertJsonFragment([
|
||||
'name' => 'test',
|
||||
'type' => ServerType::REGULAR,
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_create_server_with_caddy(): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
|
||||
SSH::fake('Active: active'); // fake output for service installations
|
||||
|
||||
$this->json('POST', route('api.projects.servers.create', [
|
||||
'project' => $this->user->current_project_id,
|
||||
]), [
|
||||
'provider' => ServerProvider::CUSTOM,
|
||||
'name' => 'test',
|
||||
'ip' => '1.1.1.1',
|
||||
'port' => '22',
|
||||
'os' => OperatingSystem::UBUNTU22,
|
||||
'webserver' => Webserver::CADDY,
|
||||
'database' => Database::MYSQL80,
|
||||
'php' => '8.2',
|
||||
])
|
||||
->assertSuccessful()
|
||||
->assertJsonFragment([
|
||||
'name' => 'test',
|
||||
'type' => ServerType::REGULAR,
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user