added a help system, replaced the words "tenant" and "Pwa" with better alternatives. corrected and implemented cron jobs. prepared going live on a coolify-powered system.

This commit is contained in:
Codex Agent
2025-11-10 16:23:09 +01:00
parent ba9e64dfcb
commit 447a90a742
123 changed files with 6398 additions and 153 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace Tests\Feature\Console;
use App\Models\Event;
use App\Models\PhotoboothSetting;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
class PhotoboothCleanupCommandTest extends TestCase
{
use RefreshDatabase;
public function test_command_disables_expired_accounts(): void
{
config([
'photobooth.control_service.base_url' => 'https://control.test',
'photobooth.control_service.token' => 'secret-token',
]);
PhotoboothSetting::current()->update([
'control_service_base_url' => 'https://control.test',
]);
$event = Event::factory()->create([
'photobooth_enabled' => true,
'photobooth_username' => 'pbcleanup',
'photobooth_status' => 'active',
'photobooth_path' => '/photobooth/demo',
'photobooth_expires_at' => now()->subDay(),
]);
$event->photobooth_password = 'CLEANUP';
$event->save();
Http::fake([
'https://control.test/*' => Http::response(['ok' => true], 200),
]);
$this->artisan('photobooth:cleanup-expired')
->assertExitCode(0);
$event->refresh();
$this->assertFalse($event->photobooth_enabled);
$this->assertNull($event->photobooth_username);
$this->assertNotNull($event->photobooth_last_deprovisioned_at);
Http::assertSent(fn ($request) => $request->url() === 'https://control.test/users/pbcleanup');
}
}