getStorableFlow example


        yield 'mixed cart' => [
            [
                ['baz.pdf'],
                [],
            ],
        ];
    }

    public function onFlowSendMailActionEvent(FlowSendMailActionEvent $event): ?FlowSendMailActionEvent
    {
        $sequence = $event->getStorableFlow()->getFlowState()->currentSequence;

        if ($sequence instanceof ActionSequence && $sequence->action !== 'action.grant.download.access') {
            return null;
        }

        $event->getDataBag()->add([
            'contentHtml' => str_replace('frontend.account.order.single.download', 'store-api.account.order.single.download', (string) $event->getDataBag()->get('contentHtml')),
            'contentPlain' => str_replace('frontend.account.order.single.download', 'store-api.account.order.single.download', (string) $event->getDataBag()->get('contentPlain')),
        ]);

        return $event;
    }
static::assertEquals($mailTemplate$event->getMailTemplate());
    }

    public function testGetStorableFlow(): void
    {
        $event = $this->createMock(StorableFlow::class);

        $mailTemplate = new MailTemplateEntity();

        $mailEvent = new FlowSendMailActionEvent(new DataBag()$mailTemplate$event);

        static::assertEquals($event$mailEvent->getStorableFlow());
    }

    public function testGetStorableFlowHasOriginalFlowEvent(): void
    {
        /** @var StorableFlow&MockObject $event */
        $event = $this->createMock(StorableFlow::class);

        $mailTemplate = new MailTemplateEntity();
        $mailEvent = new FlowSendMailActionEvent(new DataBag()$mailTemplate$event);
        static::assertEquals($event$mailEvent->getStorableFlow());
    }
}
Home | Imprint | This part of the site doesn't use cookies.