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']); }
function it_clears_all_theme_configurations(ConfigurationProcessorInterface $configurationProcessor) { $configurationProcessor->process([['name' => 'theme/name1']])->willReturn(['name' => 'theme/name1']); $configurationProcessor->process([['name' => 'theme/name2']])->willReturn(['name' => 'theme/name2']); $this->add(['name' => 'theme/name1']); $this->add(['name' => 'theme/name2']); $this->clear(); $this->findAll()->shouldReturn([]); }
/** * {@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); }
/** * {@inheritdoc} */ public function add(array $configuration) { $this->initializeIfNeeded(); $configuration = $this->configurationProcessor->process([$configuration]); $configuration['path'] = $this->getThemeDirectory($configuration['name']); $this->initializeTheme($configuration['name']); $configurations = $this->load(); $configurations[] = $configuration; $this->save($configurations); }