assertMailEvent example

static::assertInstanceOf(RedirectResponse::class$response);
        static::assertEquals('/account/register', $response->getTargetUrl());

        $session = $this->getSession();
        static::assertInstanceOf(Session::class$session);
        $success = $session->getFlashBag()->get('success');

        static::assertNotEmpty($success);
        static::assertEquals($container->get('translator')->trans('account.optInRegistrationAlert')$success[0]);

        static::assertNotEmpty($event);
        static::assertMailEvent(CustomerDoubleOptInRegistrationEvent::class$event$this->salesChannelContext);
        static::assertMailRecipientStructEvent($this->getMailRecipientStruct($data->all())$event);

        static::assertStringEndsWith('&redirectTo=frontend.checkout.confirm.page', $event->getConfirmUrl());
    }

    public function testRegisterWithDoubleOptInDomainChanged(): void
    {
        $container = $this->getContainer();

        /** @var EntityRepository $customerRepository */
        $customerRepository = $container->get('customer.repository');

        
Home | Imprint | This part of the site doesn't use cookies.