Refactor CancelStaleWorkflowCronJobTest to simplify setup

Replaced KernelTestCase with TestCase to simplify test setup and removed dependency on the database connection. Added NullLogger to replace mocked LoggerInterface during testing. Updated method call in tests to correctly reference CancelStaleWorkflowMessage class.
This commit is contained in:
2024-09-09 15:16:10 +02:00
parent f4356ac249
commit 2fb46c65c2
2 changed files with 6 additions and 14 deletions

View File

@@ -49,7 +49,7 @@ class CancelStaleWorkflowCronJob implements CronJobInterface
$olderThanDate = $this->clock->now()->sub(new \DateInterval(self::KEEP_INTERVAL));
$staleWorkflowIds = $this->workflowRepository->findWorkflowsWithoutFinalStepAndOlderThan($olderThanDate);
$lastCanceled = self::LAST_CANCELED_WORKFLOW;
$lastCanceled = $lastExecutionData[self::LAST_CANCELED_WORKFLOW] ?? 0;
$processedCount = 0;
foreach ($staleWorkflowIds as $wId) {