예제 #1
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());
 }
예제 #3
0
 public function testResumingFinishedExecutionThrowsException()
 {
     $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 = true;
     $pipe->accept(new ymcPipeSetIdVisitor());
     $execution->start();
     $this->assertEquals(ymcPipeExecution::FINISHED, $execution->executionState);
     try {
         $execution->resume();
     } catch (Exception $e) {
         return;
     }
     $this->fail('Expected exception');
 }