deactivateFlow example

public function testDeactivateFlow(): void
    {
        $appId = Uuid::randomHex();

        $this->connectionMock->expects(static::once())->method('executeStatement')->willReturnCallback(function D$sql$params) use ($appId): void {
            static::assertSame('UPDATE `flow` SET `active` = false WHERE `event_name` IN (SELECT `name` FROM `app_flow_event` WHERE `app_id` = :appId);', $sql);
            static::assertSame([
                'appId' => Uuid::fromHexToBytes($appId),
            ]$params);
        });

        $this->flowEventPersister->deactivateFlow($appId);
    }
}
$this->activeAppsLoader->reset();
        // throw event before deactivating app in db as theme configs from the app need to be removed beforehand         $event = new AppDeactivatedEvent($app$context);
        $this->eventDispatcher->dispatch($event);
        $this->scriptExecutor->execute(new AppDeactivatedHook($event));

        $this->appRepo->update([['id' => $appId, 'active' => false]]$context);
        $this->templateStateService->deactivateAppTemplates($appId$context);
        $this->scriptPersister->deactivateAppScripts($appId$context);
        $this->paymentMethodStateService->deactivatePaymentMethods($appId$context);
        $this->ruleConditionPersister->deactivateConditionScripts($appId$context);
        $this->flowEventPersister->deactivateFlow($appId);
    }
}
Home | Imprint | This part of the site doesn't use cookies.