TestFlowBusinessEvent example

'test@example.com'
        ));
        $event->setFlowState(new FlowState());
        $hookables = $this->hookableEventFactory->createHookablesFor($event);

        static::assertEmpty($hookables);
    }

    public function testDoesCreateHookableBusinessEvent(): void
    {
        $hookables = $this->hookableEventFactory->createHookablesFor(
            new TestFlowBusinessEvent(Context::createDefaultContext())
        );

        static::assertCount(1, $hookables);
        static::assertInstanceOf(HookableBusinessEvent::class$hookables[0]);
    }

    public function testCreatesHookableEntityInsert(): void
    {
        $id = Uuid::randomHex();

        /** @var EntityRepository $productRepository */
        
$event = new CustomAppEvent('custom_app_event', $data$this->context);

        $stored = [];
        $stored = $this->customAppStorer->store($event$stored);

        static::assertEquals($expected$stored);
    }

    public function testStoreWithNotAware(): void
    {
        $event = new TestFlowBusinessEvent($this->context);

        $stored = [];
        $stored = $this->customAppStorer->store($event$stored);
        static::assertEmpty($stored);
    }
}
$connection->executeStatement('DELETE FROM `log_entry`');
    }

    public function testWriteFlowEvents(): void
    {
        $handler = new TestHandler();
        $logger = new Logger('testlogger', [$handler]);

        $service = new LoggingService('test', $logger);

        $service->logFlowEvent(
            new FlowLogEvent(TestFlowBusinessEvent::EVENT_NAME, new TestFlowBusinessEvent($this->context))
        );

        $records = $handler->getRecords();

        static::assertCount(1, $records);
        $testRecord = $records[0];

        static::assertEquals(TestFlowBusinessEvent::EVENT_NAME, $testRecord->message);
        static::assertEquals('test', $testRecord->context['environment']);
        static::assertEquals(Level::Debug, $testRecord->level);
        static::assertEmpty($testRecord->context['additionalData']);
    }
Home | Imprint | This part of the site doesn't use cookies.