Files
coolify/tests/Feature/ProxyAcmeCertificateUiTest.php
T
Andras Bacsai 1f4006ac49 test: remove tests that do not exercise app code
Remove tests that copy app logic into the test, grep PHP source as
text, only check literals, constants, class_exists or PHP built-ins,
duplicate other tests, or are always skipped. Keep source checks that
guard security and authorization rules.

Rename a duplicate Pest helper so the full suite loads, drop the
missing v5/Browser path, and remove the CLAUDE.md symlink in favor of
AGENTS.md. Correct AGENTS.md: Dusk is not installed and the upgrade
script is scripts/upgrade.sh.
2026-09-28 11:55:56 +02:00

27 lines
990 B
PHP

<?php
it('gates Traefik ACME certificate deletion behind update authorization', function () {
$view = file_get_contents(resource_path('views/livewire/server/proxy.blade.php'));
$component = file_get_contents(app_path('Livewire/Server/Proxy.php'));
expect($view)
->toContain('submitAction="deleteTraefikCertificate')
->toContain("@can('update', \$server)")
->and($component)
->toContain("\$this->authorize('update', \$this->server)");
});
it('uses bounded reads and atomic restricted writes for the ACME file', function () {
$reader = file_get_contents(app_path('Actions/Proxy/GetTraefikCertificates.php'));
$writer = file_get_contents(app_path('Actions/Proxy/SaveTraefikAcmeFile.php'));
expect($reader)
->toContain('MAX_FILE_SIZE_BYTES')
->toContain('head -c')
->toContain('base64')
->and($writer)
->toContain('umask 077')
->toContain('chmod 600')
->toContain('mv --');
});