InstanceSettings::updateOrCreate(['id' => 0], [])); $team = Team::factory()->create(); $user = User::factory()->create(); $team->members()->attach($user->id, ['role' => $role]); $this->actingAs($user); session(['currentTeam' => $team]); $server = Server::factory()->create([ 'team_id' => $team->id, 'private_key_id' => PrivateKey::factory()->create(['team_id' => $team->id])->id, ]); $destination = StandaloneDocker::where('server_id', $server->id)->first() ?? StandaloneDocker::factory()->create(['server_id' => $server->id, 'network' => 'coolify-test']); $environment = Environment::factory()->create([ 'project_id' => Project::factory()->create(['team_id' => $team->id])->id, ]); $database = StandalonePostgresql::create([ 'uuid' => (string) Str::uuid(), 'name' => 'pg-test', 'postgres_password' => 'secret', 'environment_id' => $environment->id, 'destination_id' => $destination->id, 'destination_type' => $destination->getMorphClass(), ]); LocalPersistentVolume::create([ 'uuid' => (string) Str::uuid(), 'name' => $database->uuid.'-data', 'mount_path' => '/var/lib/postgresql/data', 'resource_id' => $database->id, 'resource_type' => $database->getMorphClass(), ]); Livewire::test(All::class, ['resource' => $database]) ->assertSet('canUpdate', $showsActions) ->assertSet('showActionsColumn', $showsActions); })->with([ 'owner' => ['owner', true], 'member' => ['member', false], ]);