U-D/U-E/O5: Prozess-Tester im eigenen Prozess (standardmäßig gesperrt, 15 Negativtests, statischer Wächter), Szenarien und Bericht, Kanalereignisse (API-Eingang ohne Umbau von iCal/Mail), Abschluss nach finanzieller Klärung, Löschfrist 30 Tage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c255783cec
commit
0689c0a591
68 files changed
+3350
-35
No files matched your search
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Process;
|
||||
|
||||
use App\Actions\AnonymizeGuests;
|
||||
use App\Models\Channel;
|
||||
use App\Models\ProcessTestRun;
|
||||
use App\Models\Property;
|
||||
use App\Models\User;
|
||||
use App\Support\SystemSettings;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Database\Seeders\PropertySeeder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Decision O3: reports of the process tester are deleted after 30 days by the existing retention job; the period is
|
||||
* part of the retention settings (System › Löschfristen).
|
||||
*/
|
||||
#[Group('sandbox')]
|
||||
class ProcessTestRunRetentionTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_reports_older_than_the_retention_period_are_deleted(): void
|
||||
{
|
||||
$this->travelTo(CarbonImmutable::parse('2026-10-23 10:00'));
|
||||
$this->seed(PropertySeeder::class);
|
||||
$channel = Channel::websiteOf(Property::sole());
|
||||
$user = User::factory()->create();
|
||||
$run = fn (): ProcessTestRun => ProcessTestRun::query()->create(['tenant_id' => $channel->tenant_id, 'channel_id' => $channel->id, 'user_id' => $user->id, 'intake' => 'inquiry', 'scenario' => 'complete_request', 'configuration' => [], 'inputs' => [], 'steps' => 1, 'report' => [], 'outcome' => ProcessTestRun::COMPLETED]);
|
||||
|
||||
$old = $run();
|
||||
$this->travel(29)->days();
|
||||
$recent = $run();
|
||||
$this->travel(2)->days();
|
||||
|
||||
$this->assertSame(30, config('fewo.retention.process_test_run_days'));
|
||||
$this->assertArrayHasKey('fewo.retention.process_test_run_days', SystemSettings::EDITABLE);
|
||||
app(AnonymizeGuests::class)->handle();
|
||||
|
||||
$this->assertModelMissing($old);
|
||||
$this->assertModelExists($recent);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user