AppFlowActionEntity example

public function testGetSubscribedEvents(): void
    {
        static::assertEquals([
            'app_flow_action.loaded' => 'unserialize',
        ], AppFlowActionLoadedSubscriber::getSubscribedEvents());
    }

    public function testUnserialize(): void
    {
        $idFlowAction = Uuid::randomHex();

        $appFlowAction = new AppFlowActionEntity();
        $appFlowAction->setId($idFlowAction);
        $iconPath = __DIR__ . '/../../Manifest/_fixtures/icon.png';

        $fileIcon = '';
        if (file_exists($iconPath)) {
            $fileIcon = \file_get_contents($iconPath);
        }

        $appFlowAction->setIconRaw($fileIcon !== false ? $fileIcon : null);

        $subscriber = new AppFlowActionLoadedSubscriber();
        
$addCustomerTag = new AddCustomerTagAction($this->createMock(EntityRepository::class));
        $removeOrderTag = new RemoveOrderTagAction($this->createMock(EntityRepository::class));

        $eventDispatcher = $this->createMock(EventDispatcherInterface::class);
        $eventDispatcher->expects(static::once())->method('dispatch');

        $appFlowActionRepo = $this->createMock(EntityRepository::class);
        $entitySearchResult = $this->createMock(EntitySearchResult::class);
        $entitySearchResult->expects(static::once())
            ->method('getEntities')
            ->willReturn(new EntityCollection([
                (new AppFlowActionEntity())->assign([
                    'id' => Uuid::randomHex(),
                    'name' => 'slack.app',
                    'requirements' => ['orderAware'],
                    'delayable' => false,
                ]),
            ]));

        $appFlowActionRepo->expects(static::once())
            ->method('search')
            ->willReturn($entitySearchResult);

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