startFrw example

$trackingEventClient = $this->createMock(TrackingEventClient::class);
        $trackingEventClient->expects(static::once())
            ->method('fireTrackingEvent')
            ->with('First Run Wizard started');

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

        $frwService->startFrw($this->context);
    }

    public function testFrwLoginFailsIfContextSourceIsNotAdminApi(): void
    {
        $frwClient = $this->createMock(FirstRunWizardClient::class);
        $frwClient->method('frwLogin')
            ->willThrowException(new InvalidContextSourceException(AdminApiSource::class, SystemSource::class));

        $frwService = new FirstRunWizardService(
            $this->createMock(StoreService::class),
            $this->createMock(SystemConfigService::class),
            
public function __construct(
        private readonly FirstRunWizardService $frwService,
        private readonly EntityRepository $pluginRepo,
        private readonly EntityRepository $appRepo,
    ) {
    }

    #[Route(path: '/api/_action/store/frw/start', name: 'api.custom.store.frw.start', methods: ['POST'])]     public function frwStart(Context $context): JsonResponse
    {
        try {
            $this->frwService->startFrw($context);
        } catch (ClientException $exception) {
            throw new StoreApiException($exception);
        }

        return new JsonResponse();
    }

    #[Route(path: '/api/_action/store/language-plugins', name: 'api.custom.store.language-plugins', methods: ['GET'])]     public function getLanguagePluginList(Context $context): JsonResponse
    {
        /** @var PluginCollection $plugins */
        
Home | Imprint | This part of the site doesn't use cookies.