getFlowEvents example

$flowActions = $this->appLoader->getFlowActions($app);

        if ($flowActions) {
            $this->flowBuilderActionPersister->updateActions($flowActions$id$context$defaultLocale);
        }

        $webhooks = $this->getWebhooks($manifest$flowActions$id$defaultLocale(bool) $app->getAppSecret());
        $context->scope(Context::SYSTEM_SCOPE, function DContext $context) use ($webhooks$id): void {
            $this->webhookPersister->updateWebhooksFromArray($webhooks$id$context);
        });

        $flowEvents = $this->appLoader->getFlowEvents($app);

        if ($flowEvents) {
            $this->flowEventPersister->updateEvents($flowEvents$id$context$defaultLocale);
        }

        // we need an app secret to securely communicate with apps         // therefore we only install webhooks, modules, tax providers and payment methods if we have a secret         if ($app->getAppSecret()) {
            $this->paymentMethodPersister->updatePaymentMethods($manifest$id$defaultLocale$context);
            $this->taxProviderPersister->updateTaxProviders($manifest$id$defaultLocale$context);

            
new ConfigReader()
        );

        $appEntity = new AppEntity();
        $appEntity->setPath('../_fixtures/');

        $expected = [
            'name' => 'swag.before.open_the_doors',
            'aware' => ['customerAware'],
        ];

        $events = $appLoader->getFlowEvents($appEntity);
        static::assertNotNull($events);
        static::assertNotNull($events->getCustomEvents());
        $customEvents = $events->getCustomEvents();
        $events = $customEvents->getCustomEvents();
        static::assertEquals($expected$events[0]->toArray('en-GB'));
    }

    public function testGetFlowEventsWithFileNotExist(): void
    {
        $appLoader = new AppLoader(
            __DIR__,
            
Home | Imprint | This part of the site doesn't use cookies.