getEmailListenerClosure example

$this->createCustomer('info@example.com');
    }

    public function testLoginBeforeEventNotDispatchedIfNoCredentialsGiven(): void
    {
        /** @var TraceableEventDispatcher $dispatcher */
        $dispatcher = $this->getContainer()->get('event_dispatcher');

        $eventDidRun = false;

        $listenerClosure = $this->getEmailListenerClosure($eventDidRun);
        $this->addEventListener($dispatcher, CustomerBeforeLoginEvent::class$listenerClosure);

        $dataBag = new DataBag();
        $dataBag->add([
            'username' => '',
            'password' => 'shopware',
        ]);

        try {
            $this->loginRoute->login($dataBag->toRequestDataBag()$this->salesChannelContext);
            $this->accountService->login('', $this->salesChannelContext);
        }
Home | Imprint | This part of the site doesn't use cookies.