getIconSets example

$viewPaths = $this->inner->getTemplatePathsForApp($app);

        $resourceDirectory = $this->appLoader->locatePath($app->getPath(), 'Resources');

        if ($resourceDirectory === null) {
            return $viewPaths;
        }

        $relativeAppPath = str_replace($this->projectDir . '/', '', $app->getPath());
        $storefrontConfig = $this->storefrontPluginConfigurationFactory->createFromApp($app->getMetadata()->getName()$relativeAppPath);

        if (!is_dir($resourceDirectory) || !$storefrontConfig->getIconSets()) {
            return $viewPaths;
        }

        $finder = new Finder();
        $finder->files()
            ->in($resourceDirectory)
            ->name(['*.html.twig', '*.svg'])
            ->path(array_values($storefrontConfig->getIconSets()))
            ->ignoreUnreadableDirs();

        // return file paths relative to Resources/views directory
static::assertEquals($basePath . '/Resources/app/storefront/dist/assets/preview.jpg', $config->getPreviewMedia());
        static::assertEquals([
            'fields' => [
                'sw-image' => [
                    'type' => 'media',
                    'value' => 'app/storefront/dist/assets/test.jpg',
                ],
            ],
        ]$config->getThemeConfig());
        static::assertEquals([
            'custom-icons' => 'app/storefront/src/assets/icon-pack/custom-icons',
        ]$config->getIconSets());
    }

    public function testPluginHasSingleScssEntryPoint(): void
    {
        /** @var string $basePath */
        $basePath = realpath(__DIR__ . '/../fixtures/SimplePlugin');
        $bundle = $this->getBundle('SimplePlugin', $basePath);

        $basePath = $this->stripProjectDir($basePath);

        $config = $this->configFactory->createFromBundle($bundle);

        
if (!$theme) {
            return;
        }

        $themeConfig = $this->themeRegistry->getConfigurations()->getByTechnicalName($theme);

        if (!$themeConfig) {
            return;
        }

        $iconConfig = [];
        foreach ($themeConfig->getIconSets() as $pack => $path) {
            $iconConfig[$pack] = [
                'path' => $path,
                'namespace' => $theme,
            ];
        }

        $event->setParameter('themeIconConfig', $iconConfig);
    }

    private function shouldRenewToken(SessionInterface $session, ?string $salesChannelId = null): bool
    {
        
Home | Imprint | This part of the site doesn't use cookies.