Adjust logic for removing the hold on a workflow only by user who owns the hold and when a transition is applied on the workflow

This commit is contained in:
2024-08-30 12:59:08 +02:00
committed by Julien Fastré
parent 41ffc470a0
commit 745a29f742
5 changed files with 48 additions and 26 deletions

View File

@@ -30,6 +30,7 @@ class WorkflowOnHoldControllerTest extends KernelTestCase
private $workflow;
private $currentStep;
private $currentUser;
private $controller;
protected function setUp(): void
{
@@ -53,6 +54,13 @@ class WorkflowOnHoldControllerTest extends KernelTestCase
$this->registry->method('get')->with($this->entityWorkflow, 'workflow_name')->willReturn($this->workflow);
$this->workflow->method('getEnabledTransitions')->with($this->entityWorkflow)->willReturn([]);
$this->entityWorkflow->method('getUsersInvolved')->willReturn([]);
$this->controller = new WorkflowOnHoldController(
$this->entityManager,
$this->security,
$this->registry,
$this->entityWorkflowStepHoldRepository
);
}
public function testPutOnHoldPersistence(): void
@@ -76,13 +84,6 @@ class WorkflowOnHoldControllerTest extends KernelTestCase
$this->entityManager->expects($this->once())
->method('flush');
$controller = new WorkflowOnHoldController(
$this->entityManager,
$this->security,
$this->registry,
$this->entityWorkflowStepHoldRepository
);
$request = new Request();
$controller->putOnHold($this->entityWorkflow, $request);
}