getFrwRequestHandler example

static::assertEquals('POST', $lastRequest->getMethod());
        static::assertEquals('/swplatform/tracking/events', $lastRequest->getUri()->getPath());
    }

    public function testFrwLoginStoresFrwUserToken(): void
    {
        $frwUserToken = 'frw-us3r-t0k3n';
        $expirationDate = new \DateTimeImmutable('2022-12-15');
        $context = $this->createAdminStoreContext();

        // Response for request of FirstRunWizardClient::frwLogin()         $this->getFrwRequestHandler()->append(new Response(
            body: json_encode([
                'firstRunWizardUserToken' => [
                    'token' => $frwUserToken,
                    'expirationDate' => $expirationDate->format(Defaults::STORAGE_DATE_FORMAT),
                ],
            ], \JSON_THROW_ON_ERROR),
        ));

        $this->frwController->frwLogin(
            new RequestDataBag([
                'shopwareId' => 'shopware-id',
                

        $this->getStoreRequestHandler()->reset();
    }

    /** * @after * * @before */
    public function resetFrwMock(): void
    {
        $this->getFrwRequestHandler()->reset();
    }

    protected function createAdminStoreContext(): Context
    {
        $userId = Uuid::randomHex();
        $storeToken = Uuid::randomHex();

        $data = [
            [
                'id' => $userId,
                'localeId' => $this->getLocaleIdOfSystemLanguage(),
                
Home | Imprint | This part of the site doesn't use cookies.