public function __construct(IntrospectedWorkflow $instrospectedWorkflow) { $this->workflowName = $instrospectedWorkflow->getWorkflowName(); $colors = $this->assignUniqueColorToStates($instrospectedWorkflow->getIntrospectedStates()); $this->jsonableStates = $this->createStatesRepresentation($instrospectedWorkflow->getIntrospectedStates(), $colors); $this->jsonableTransitions = $this->createTransitionsRepresentation($instrospectedWorkflow->getIntrospectedTransitions(), $colors); }
public function test_it_should_introspect_workflow_states() { // Given $stateWorkflow = $this->createValidStateWorkflow(); $expected = $this->createExpectedStates(); $expected['a']->setIsRoot(); $expected['c']->setIsLeaf(); // When $introspectedWorkflow = new SUT($stateWorkflow); $actual = $introspectedWorkflow->getIntrospectedStates(); // Then $this->assertEquals($expected, $actual, 'State are not well introspected anymore.'); }