Files
fewo-stommer/tests/Feature/SchedulerEndpointTest.php
Lars StommerandClaude Opus 5.5 8d904660b9 Automatisches Deployment nach Strato (atomare Releases, Rollback, Gitea Actions)
- scripts/deploy.sh: Build aus Git-Stand (Composer ohne Dev, Vite), Upload per SSH, Migration, Caches, atomarer Umschalter current -> releases/<zeit>, Gesundheitscheck mit automatischem Rollback; Befehle setup/deploy/rollback/releases/artisan; lokaler Testmodus
- .gitea/workflows/deploy.yml: Tests bei jedem Push, Deployment bei Tags v* oder per Knopfdruck
- Vorlagen scripts/deploy.example.env und .env.production.example (Strato MySQL, SMTP, IMAP)
- Scheduler-Endpunkt /automation/scheduler als Ausweich für fehlende Cronjobs
- ProductionSeeder für die Ersteinrichtung ohne Testdaten

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:28:00 +02:00

26 lines
747 B
PHP

<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class SchedulerEndpointTest extends TestCase
{
use RefreshDatabase;
public function test_scheduler_endpoint_is_disabled_without_token(): void
{
$this->get('/automation/scheduler')->assertNotFound();
$this->get('/automation/scheduler?token=irgendwas')->assertNotFound();
}
public function test_scheduler_runs_with_the_configured_token(): void
{
config(['fewo.scheduler_token' => 'geheim']);
$this->get('/automation/scheduler?token=falsch')->assertNotFound();
$this->getJson('/automation/scheduler?token=geheim')->assertOk()->assertJsonStructure(['ran_at', 'output']);
}
}