getAware example

public function testFromXml(): void
    {
        $flowEvents = Event::createFromXmlFile(__DIR__ . '/../_fixtures/valid/flowEventWithFlowEvents.xml');

        static::assertNotNull($flowEvents->getCustomEvents());
        static::assertCount(1, $flowEvents->getCustomEvents()->getCustomEvents());

        $firstEvent = $flowEvents->getCustomEvents()->getCustomEvents()[0];
        static::assertNotNull($firstEvent->getName());

        static::assertEquals('checkout.order.place.custom', $firstEvent->getName());
        static::assertEquals(['orderAware', 'customerAware']$firstEvent->getAware());
    }
}


    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $result = $this->collector->collect(Context::createDefaultContext());

        $table = new Table($output);
        $table->setHeaders(['name', 'mail-aware', 'log-aware', 'class']);
        foreach ($result as $definition) {
            $table->addRow([
                $definition->getName(),
                (int) $definition->getAware('mailAware'),
                (int) $definition->getAware('logAware'),
                $definition->getClass(),
            ]);
        }
        $table->render();

        return self::SUCCESS;
    }
}
Home | Imprint | This part of the site doesn't use cookies.