/** * @param array $configuration * @param $fileName * @return array * @throws InvalidConfigurationException */ protected function parseConfiguration(array $configuration, $fileName) { try { $definitionsData = array(); if (!empty($configuration[self::NODE_DEFINITIONS])) { $definitionsData = $this->definitionConfiguration->processConfiguration($configuration[self::NODE_DEFINITIONS]); } $triggersData = array(); if (!empty($configuration[self::NODE_TRIGGERS])) { $triggersData = $this->triggerConfiguration->processConfiguration($configuration[self::NODE_TRIGGERS]); } } catch (InvalidConfigurationException $exception) { $message = sprintf('Can\'t parse process configuration from %s. %s', $fileName, $exception->getMessage()); throw new InvalidConfigurationException($message); } return array($definitionsData, $triggersData); }
/** * @param array $input * @param array $expected * @dataProvider processDataProvider */ public function testProcess(array $input, array $expected) { $this->assertSame($expected, $this->configuration->processConfiguration($input)); }