customerGroupRegistration example

$request->attributes->set('_route', 'frontend.account.customer-group-registration.page');
        $dataBag = new RequestDataBag();
        $page = new CustomerGroupRegistrationPage();
        $page->setGroup(new CustomerGroupEntity());
        $customerGroupId = Uuid::randomHex();

        $this->customerGroupRegistrationPageLoader->expects(static::once())
            ->method('load')
            ->with($request$context)
            ->willReturn($page);

        $this->controller->customerGroupRegistration($customerGroupId$request$dataBag$context);

        static::assertSame($page$this->controller->renderStorefrontParameters['page']);
        static::assertSame($dataBag$this->controller->renderStorefrontParameters['data']);
        static::assertSame('frontend.account.home.page', $this->controller->renderStorefrontParameters['redirectTo'] ?? '');
        static::assertSame('frontend.account.customer-group-registration.page', $this->controller->renderStorefrontParameters['errorRoute'] ?? '');
        static::assertSame(json_encode(['customerGroupId' => $customerGroupId])$this->controller->renderStorefrontParameters['errorParameters'] ?? '');
        static::assertInstanceOf(CustomerGroupRegistrationPageLoadedHook::class$this->controller->calledHook);
    }

    public function testRegisterSuccess(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.