DatabaseConfigLoader example

$themeService = new ThemeService(
            new StorefrontPluginRegistry(
                $kernel,
                $this->getContainer()->get(StorefrontPluginConfigurationFactory::class),
                $this->getContainer()->get(ActiveAppsLoader::class)
            ),
            $this->getContainer()->get('theme.repository'),
            $this->getContainer()->get('theme_sales_channel.repository'),
            $themeCompilerMock,
            $this->getContainer()->get('event_dispatcher'),
            new DatabaseConfigLoader(
                $this->getContainer()->get('theme.repository'),
                new StorefrontPluginRegistry(
                    $kernel,
                    $this->getContainer()->get(StorefrontPluginConfigurationFactory::class),
                    $this->getContainer()->get(ActiveAppsLoader::class)
                ),
                $this->getContainer()->get('media.repository'),
            ),
            $this->getContainer()->get(Connection::class)
        );
        $themeService->updateTheme(
            
$this->themeRepository->create($theme, Context::createDefaultContext());

        $collection = new StorefrontPluginConfigurationCollection([
            new StorefrontPluginConfiguration('base'),
        ]);

        $registry = $this->createMock(StorefrontPluginRegistry::class);
        $registry->method('getConfigurations')
            ->willReturn($collection);

        $service = new DatabaseConfigLoader(
            $this->themeRepository,
            $registry,
            $this->mediaRepository,
            'base',
        );

        $config = $service->load($this->ids->get('base'), Context::createDefaultContext());

        $themeConfig = $config->getThemeConfig();
        static::assertNotNull($themeConfig);

        
Home | Imprint | This part of the site doesn't use cookies.