Пример #1
0
 public function testCreateNode()
 {
     $pipe = new ymcPipe();
     $node = $pipe->createNode('ymcPipeBasicNodeMock', 'myname');
     $this->assertTrue(false !== $pipe->nodes->contains($node));
     $this->assertEquals('myname', $node->name);
 }
Пример #2
0
 public function testVisitOneNodeAndGetConfig()
 {
     $pipe = new ymcPipe();
     $node = $pipe->createNode('ymcPipeNodeForConfigTest');
     $node->_initConfiguration(array('item' => array('type' => ymcPipeNodeConfiguration::TYPE_STRING)));
     $visitor = new ymcPipeConfigurationEditorVisitor();
     $pipe->accept($visitor);
     // nodes do not have id's yet! This could fail sometime
     $this->assertEquals(array(array('item' => array('type' => ymcPipeNodeConfiguration::TYPE_STRING, 'value' => ''))), $visitor->getConfigurations());
 }
 public function testExecute()
 {
     $pipe = new ymcPipe();
     $node = $pipe->createNode('ymcPipeGetExecutionVariableNode');
     $node->config->variable = 'test';
     $execution = new ymcPipeExecutionNonSuspendable();
     $execution->pipe = $pipe;
     $execution->variables['test'] = 'vvv';
     $pipe->accept(new ymcPipeSetIdVisitor());
     $execution->start();
     $this->assertEquals('vvv', $node->getOutput());
 }
Пример #4
0
 public function testUpdateExecution()
 {
     $db = $this->getEmptyDb();
     $execution = new ymcPipeExecutionDatabase($db);
     $execution->setPipe('testPipe', 11);
     $defStorage = new ymcPipeDefinitionStorageMock();
     $pipe = new ymcPipe();
     $defStorage->pipe = $pipe;
     $node = $pipe->createNode('ymcPipeNodeForExecutionMock');
     $execution->definitionStorage = $defStorage;
     $node->todo = false;
     $node->id = 1;
     $execution->start();
     $execution->store();
     $newExecution = new ymcPipeExecutionDatabase($db, $execution->id);
     $newExecution->definitionStorage = $defStorage;
     $newExecution->pipe;
     $node->todo = true;
     $node->variables['test'] = 'value';
     $newExecution->store();
     $newnewExecution = new ymcPipeExecutionDatabase($db, $execution->id);
     $pipe = new ymcPipe();
     $defStorage->pipe = $pipe;
     $node = $pipe->createNode('ymcPipeNodeForExecutionMock');
     $node->id = 1;
     $newnewExecution->definitionStorage = $defStorage;
     $newnewExecution->pipe;
     $newnewExecution->store();
     $this->assertEquals('value', $node->variables['test']);
 }
Пример #5
0
 public function testUnfinishedExecutionSetsStateToSuspended()
 {
     $pipe = new ymcPipe();
     $node = $pipe->createNode('ymcPipeNodeForExecutionMock');
     $node->todo = false;
     $execution = new ymcPipeExecutionActivationMock();
     $execution->setPipe($pipe);
     $pipe->accept(new ymcPipeSetIdVisitor());
     $execution->start();
     $this->assertEquals(ymcPipeExecution::SUSPENDED, $execution->executionState);
 }