function it_processes_the_configuration_and_extracts_extra_sylius_theme_key_as_another_configuration(ConfigurationLoaderInterface $decoratedLoader, ConfigurationProcessorInterface $configurationProcessor) { $basicConfiguration = ['name' => 'example/sylius-theme', 'extra' => ['sylius-theme' => ['name' => 'example/brand-new-sylius-theme']]]; $decoratedLoader->load('theme-configuration-resource')->willReturn($basicConfiguration); $configurationProcessor->process([$basicConfiguration, ['name' => 'example/brand-new-sylius-theme']])->willReturn(['name' => 'example/brand-new-sylius-theme']); $this->load('theme-configuration-resource')->shouldReturn(['name' => 'example/brand-new-sylius-theme']); }
/** * {@inheritdoc} */ public function load($identifier) { $rawConfiguration = $this->decoratedLoader->load($identifier); $configurations = [$rawConfiguration]; if (isset($rawConfiguration['extra']['sylius-theme'])) { $configurations[] = $rawConfiguration['extra']['sylius-theme']; } return $this->configurationProcessor->process($configurations); }