mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Refactor WorkflowOnHoldController and improve tests
Refactored WorkflowOnHoldController to remove dependencies and improve redirect handling. Updated test cases to use PHPUnit instead of KernelTestCase and mock proper dependencies. Added relationship handling in EntityWorkflowStep to manage EntityWorkflowStepHold instances accurately.
This commit is contained in:
@@ -455,4 +455,13 @@ class EntityWorkflowStep
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function addOnHold(EntityWorkflowStepHold $onHold): self
|
||||
{
|
||||
if (!$this->holdsOnStep->contains($onHold)) {
|
||||
$this->holdsOnStep->add($onHold);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,10 @@ class EntityWorkflowStepHold implements TrackCreationInterface
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private EntityWorkflowStep $step, #[ORM\ManyToOne(targetEntity: User::class)]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private User $byUser) {}
|
||||
private User $byUser)
|
||||
{
|
||||
$step->addOnHold($this);
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
Reference in New Issue
Block a user