/**
  * @param array $configuration
  * @return WorkflowDefinition
  */
 public function buildFromRawConfiguration(array $configuration)
 {
     $configuration = $this->handler->handle($configuration);
     $configuration = $this->configuration->processConfiguration($configuration);
     $this->assertConfigurationOptions($configuration, array('name'));
     $name = $this->getConfigurationOption($configuration, 'name');
     return $this->configurationBuilder->buildOneFromConfiguration($name, $configuration);
 }
 /**
  * {@inheritdoc}
  */
 public function getConfigTreeBuilder()
 {
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root(self::NODE_WORKFLOWS);
     $rootNode->useAttributeAsKey('name');
     $this->workflowConfiguration->addWorkflowNodes($rootNode->prototype('array')->children());
     return $treeBuilder;
 }
 public function testProcessConfiguration()
 {
     $workflowConfiguration = new WorkflowConfiguration();
     $inputConfiguration = $this->getInputConfiguration();
     $expectedConfiguration = $this->getExpectedConfiguration();
     foreach ($inputConfiguration as $name => $configuration) {
         $this->assertArrayHasKey($name, $expectedConfiguration);
         $actualConfiguration = $workflowConfiguration->processConfiguration($configuration);
         $this->assertEquals($expectedConfiguration[$name], $actualConfiguration);
     }
 }