/**
  * @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);
 }
 /**
  * @param string $expectedException
  * @param string $expectedMessage
  * @param array $inputData
  * @dataProvider buildFromConfigurationExceptionDataProvider
  */
 public function testBuildFromConfigurationException($expectedException, $expectedMessage, array $inputData)
 {
     $this->setExpectedException($expectedException, $expectedMessage);
     $workflowAssembler = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Model\\WorkflowAssembler')->disableOriginalConstructor()->getMock();
     $fieldGenerator = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Field\\FieldGenerator')->disableOriginalConstructor()->getMock();
     $builder = new WorkflowDefinitionConfigurationBuilder($workflowAssembler, $fieldGenerator);
     $builder->buildFromConfiguration($inputData);
 }