Suffix message class with 'Message' and add check on workflow to assert no transitions were applied since message placed in queue

This commit is contained in:
2024-08-28 11:52:01 +02:00
committed by Julien Fastré
parent 5d84e997c1
commit cb446edd18
5 changed files with 43 additions and 21 deletions

View File

@@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep;
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
use Chill\MainBundle\Service\Workflow\CancelStaleWorkflow;
use Chill\MainBundle\Service\Workflow\CancelStaleWorkflowHandler;
use Chill\MainBundle\Service\Workflow\CancelStaleWorkflowMessage;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\TestCase;
@@ -51,7 +52,7 @@ class CancelStaleWorkflowHandlerTest extends TestCase
$handler = new CancelStaleWorkflowHandler($workflowRepository, $registry, $em, $logger);
$handler(new CancelStaleWorkflow(1));
$handler(new CancelStaleWorkflowMessage(1));
}
public function testInvokeWorkflowWithMultipleStepsAndValidTransition(): void
@@ -92,7 +93,7 @@ class CancelStaleWorkflowHandlerTest extends TestCase
$handler = new CancelStaleWorkflowHandler($workflowRepository, $registry, $em, $logger);
$handler(new CancelStaleWorkflow(1));
$handler(new CancelStaleWorkflowMessage(1));
}
public function testInvokeWorkflowWithMultipleStepsAndNoValidTransition(): void
@@ -134,6 +135,6 @@ class CancelStaleWorkflowHandlerTest extends TestCase
$handler = new CancelStaleWorkflowHandler($workflowRepository, $registry, $em, $logger);
$handler(new CancelStaleWorkflow(1));
$handler(new CancelStaleWorkflowMessage(1));
}
}