Skip to content

Commit dca5de8

Browse files
Update test default retention period
1 parent 958cbe5 commit dca5de8

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/Jobs/EvaluateProcessRetentionJobTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class EvaluateProcessRetentionJobTest extends TestCase
1414
{
1515
use RefreshDatabase;
1616

17-
const RETENTION_PERIOD = '6_months';
17+
const RETENTION_PERIOD = '1_year';
1818

1919
protected function setUp(): void
2020
{
@@ -297,9 +297,9 @@ public function testItDoesNotRunWhenRetentionPolicyIsDisabled()
297297
$_SERVER['CASE_RETENTION_POLICY_ENABLED'] = 'true';
298298
}
299299

300-
public function testItDefaultsToSixMonthsForProcessesWithoutRetentionPeriod()
300+
public function testItDefaultsToOneYearForProcessesWithoutRetentionPeriod()
301301
{
302-
// Create a process WITHOUT retention_period property (should default to 6 months)
302+
// Create a process WITHOUT retention_period property (should default to 1 year)
303303
$process = Process::factory()->create([
304304
'properties' => [], // No retention_period set
305305
]);
@@ -312,18 +312,18 @@ public function testItDefaultsToSixMonthsForProcessesWithoutRetentionPeriod()
312312
$processRequest->save();
313313
$processRequest->refresh();
314314

315-
// Create a case created 7 months ago (older than default 6 months retention)
316-
// Since retention_updated_at defaults to now, old cases cutoff = now - 6 months
317-
// 7 months ago < (now - 6 months), so it should be deleted
318-
$oldCaseDate = Carbon::now()->subMonths(7);
315+
// Create a case created 13 months ago (older than default 1 year retention)
316+
// Since retention_updated_at defaults to now, old cases cutoff = now - 1 year
317+
// 13 months ago < (now - 1 year), so it should be deleted
318+
$oldCaseDate = Carbon::now()->subMonths(13);
319319
$oldCase = CaseNumber::factory()->create([
320320
'process_request_id' => $processRequest->id,
321321
]);
322322
$oldCase->created_at = $oldCaseDate;
323323
$oldCase->save();
324324

325-
// Create a case created 5 months ago (within default 6 months retention)
326-
// 5 months ago is NOT < (now - 6 months), so it should NOT be deleted
325+
// Create a case created 5 months ago (within default 1 year retention)
326+
// 5 months ago is NOT < (now - 1 year), so it should NOT be deleted
327327
$newCaseDate = Carbon::now()->subMonths(5);
328328
$newCase = CaseNumber::factory()->create([
329329
'process_request_id' => $processRequest->id,
@@ -334,11 +334,11 @@ public function testItDefaultsToSixMonthsForProcessesWithoutRetentionPeriod()
334334
// Dispatch the job
335335
EvaluateProcessRetentionJob::dispatchSync($process->id);
336336

337-
// The 7-month-old case should be deleted (older than 6 months default)
338-
// The 5-month-old case should NOT be deleted (within 6 months default)
337+
// The 13-month-old case should be deleted (older than 1 year default)
338+
// The 5-month-old case should NOT be deleted (within 1 year default)
339339
// Plus the auto-created case = 2 total
340-
$this->assertNull(CaseNumber::find($oldCase->id), 'The 7-month-old case should be deleted with default 6-month retention');
341-
$this->assertNotNull(CaseNumber::find($newCase->id), 'The 5-month-old case should NOT be deleted with default 6-month retention');
340+
$this->assertNull(CaseNumber::find($oldCase->id), 'The 13-month-old case should be deleted with default 1 year retention');
341+
$this->assertNotNull(CaseNumber::find($newCase->id), 'The 5-month-old case should NOT be deleted with default 1 year retention');
342342
$this->assertDatabaseCount('case_numbers', 2);
343343
}
344344
}

0 commit comments

Comments
 (0)