Add test for detecting stale workflows and enhance handler

Added a new test to check if workflows are stale in EntityWorkflowTest. Enhanced CancelStaleWorkflowHandler to handle stale workflows more accurately, including checking if workflows have transitioned recently. Updated EntityWorkflow entity to cascade remove workflow steps.

Refactor tests for handler, to avoid using $kernel during tests
This commit is contained in:
2024-09-09 14:59:26 +02:00
parent d152efe084
commit f4356ac249
5 changed files with 226 additions and 107 deletions

View File

@@ -105,9 +105,7 @@ class CancelStaleWorkflowCronJobTest extends KernelTestCase
false => $messageBus->method('dispatch'),
};
$methodDispatch->willReturnCallback(function (CancelStaleWorkflowMessage $message) {
return new Envelope($message);
});
$methodDispatch->willReturnCallback(fn (CancelStaleWorkflowMessage $message) => new Envelope($message));
return $messageBus;
}