/** * @test */ function it_is_equal_to_a_node_with_the_same_name() { $processingNode1 = ProcessingNode::initializeAs(NodeName::fromString('localhost')); $processingNode2 = ProcessingNode::initializeAs(NodeName::fromString('localhost')); $this->assertTrue($processingNode1->sameNodeAs($processingNode2)); }
/** * @param NodeName $nodeName * @return ProcessingNode */ public function getNode(NodeName $nodeName) { //@TODO: Connect node list with configuration to assert node name return ProcessingNode::initializeAs($nodeName); }
/** * @param CreateWorkflow $command */ public function handle(CreateWorkflow $command) { $workflow = $this->processingNode->setUpNewWorkflow($command->workflowId(), $command->workflowName()); $this->workflowCollection->add($workflow); }
/** * @param ProcessingNode $other * @return bool */ public function sameNodeAs(ProcessingNode $other) { return $this->nodeName()->equals($other->nodeName()); }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { /** @var $processingConfig ProcessingConfig */ $processingConfig = $serviceLocator->get('processing_config'); return ProcessingNode::initializeAs(NodeName::fromString($processingConfig->getNodeName())); }