extensionUpdateRequiresConsentAffirmationException example



        static::assertEquals('FRAMEWORK__EXTENSION_INSTALL_EXCEPTION', $exception->getErrorCode());
        static::assertEquals(Response::HTTP_INTERNAL_SERVER_ERROR, $exception->getStatusCode());
    }

    /** * @DisabledFeatures(features={"v6.6.0.0"}) */
    public function testExtensionUpdateRequiresConsentAffirmationException(): void
    {
        $exception = StoreException::extensionUpdateRequiresConsentAffirmationException('test-app', [
            'permissions' => [
                'product' => ['read'],
                'categories' => ['read'],
            ],
        ]);

        static::assertEquals(
            'Updating app "test-app" requires a renewed consent affirmation.',
            $exception->getMessage()
        );

        
$requiresRenewedConsent = $this->appDeltaService->requiresRenewedConsent(
            $manifests[$technicalName],
            $app
        );

        if (!$allowNewPermissions && $requiresRenewedConsent) {
            $deltas = $this->appDeltaService->getReports(
                $manifests[$technicalName],
                $app
            );

            throw StoreException::extensionUpdateRequiresConsentAffirmationException($technicalName$deltas);
        }

        $this->appLifecycle->update(
            $manifests[$technicalName],
            [
                'id' => $app->getId(),
                'version' => $app->getVersion(),
                'roleId' => $app->getAclRoleId(),
            ],
            $context
        );
    }
Home | Imprint | This part of the site doesn't use cookies.