mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 13:06:13 +00:00
Get workflowComponent directly from registry
This commit is contained in:
parent
2e69d2df90
commit
b97eabf0d2
@ -26,7 +26,6 @@ class CancelStaleWorkflowHandlerTest extends KernelTestCase
|
||||
private LoggerInterface $logger;
|
||||
private EntityWorkflowRepository $workflowRepository;
|
||||
private ClockInterface $clock;
|
||||
private string $workflowName;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
@ -39,13 +38,6 @@ class CancelStaleWorkflowHandlerTest extends KernelTestCase
|
||||
$this->logger = self::getContainer()->get(LoggerInterface::class);
|
||||
$this->clock = self::getContainer()->get(ClockInterface::class);
|
||||
$this->workflowRepository = $this->createMock(EntityWorkflowRepository::class);
|
||||
|
||||
// Retrieve the workflow configuration dynamically
|
||||
$configPath = self::$kernel->getProjectDir() . '/config/packages/workflow.yaml'; // Adjust the path if needed
|
||||
$config = Yaml::parseFile($configPath);
|
||||
|
||||
// Extract the workflow name from the configuration
|
||||
$this->workflowName = array_key_first($config['framework']['workflows']);
|
||||
}
|
||||
|
||||
public function testWorkflowWithOneStepOlderThan90DaysIsDeleted(): void
|
||||
@ -82,7 +74,7 @@ class CancelStaleWorkflowHandlerTest extends KernelTestCase
|
||||
$this->em->flush();
|
||||
|
||||
/** @var WorkflowInterface $workflowComponent */
|
||||
$workflowComponent = $this->registry->get($workflow, $this->workflowName);
|
||||
$workflowComponent = $this->registry->get($workflowComponent);
|
||||
|
||||
$transitions = $workflowComponent->getEnabledTransitions($workflow);
|
||||
$metadataStore = $workflowComponent->getMetadataStore();
|
||||
|
Loading…
x
Reference in New Issue
Block a user