getLanguagePlugins example

Request::METHOD_GET,
                '/swplatform/firstrunwizard/localizations',
                [
                    'query' => [],
                ],
            ],
            $languagePlugins
        );

        static::assertEquals(
            $languagePlugins,
            $frwClient->getLanguagePlugins($this->context)
        );
    }

    public function testGetDemodataPlugins(): void
    {
        $languagePlugins = [
            [
                'id' => 123456,
                'name' => 'SwagLanguagePack',
            ],
        ];

        


    #[Route(path: '/api/_action/store/language-plugins', name: 'api.custom.store.language-plugins', methods: ['GET'])]     public function getLanguagePluginList(Context $context): JsonResponse
    {
        /** @var PluginCollection $plugins */
        $plugins = $this->pluginRepo->search(new Criteria()$context)->getEntities();
        /** @var AppCollection $apps */
        $apps = $this->appRepo->search(new Criteria()$context)->getEntities();

        try {
            $languagePlugins = $this->frwService->getLanguagePlugins($plugins$apps$context);
        } catch (ClientException $exception) {
            throw new StoreApiException($exception);
        }

        return new JsonResponse([
            'items' => $languagePlugins,
            'total' => \count($languagePlugins),
        ]);
    }

    #[Route(path: '/api/_action/store/demo-data-plugins', name: 'api.custom.store.demo-data-plugins', methods: ['GET'])]
/** * @throws StoreLicenseDomainMissingException * @throws ClientException * * @return StorePluginStruct[] */
    public function getLanguagePlugins(
        PluginCollection $pluginCollection,
        AppCollection $appCollection,
        Context $context,
    ): array {
        $languagePlugins = $this->frwClient->getLanguagePlugins($context);

        return $this->mapExtensionData($languagePlugins$pluginCollection$appCollection);
    }

    /** * @throws StoreLicenseDomainMissingException * @throws ClientException * * @return StorePluginStruct[] */
    public function getDemoDataPlugins(
        


        $frwClient = $this->createMock(FirstRunWizardClient::class);
        $frwClient->expects(static::once())
            ->method('getLanguagePlugins')
            ->willReturn($languagePlugins);

        $frwService = $this->createFirstRunWizardService(
            frwClient: $frwClient,
        );

        $languagePlugins = $frwService->getLanguagePlugins(new PluginCollection()new AppCollection()$this->context);
        static::assertCount(1, $languagePlugins);
    }

    public function testGetDemodataPlugins(): void
    {
        $demodataPlugins = [
            [
                'id' => 123456,
                'name' => 'SwagDemodata',
                'label' => 'Shopware Demodata Plugin',
                'iconPath' => 'https://example.com/icon.png',
                
Home | Imprint | This part of the site doesn't use cookies.