DemodataCommand example

MailTemplateDefinition::class,
        MailHeaderFooterDefinition::class,
    ];

    private EventDispatcher $dispatcher;

    private DemodataCommand $command;

    protected function setUp(): void
    {
        $this->dispatcher = new EventDispatcher();
        $this->command = new DemodataCommand(
            $this->createMock(DemodataService::class),
            $this->dispatcher,
            $this->getName() === 'testShowNoticeWhenNotProd' ? 'dev' : 'prod'
        );
    }

    public function testShowNoticeWhenNotProd(): void
    {
        $eventCalled = false;
        $this->dispatcher->addListener(DemodataRequestCreatedEvent::classstatic function D) use (&$eventCalled): void {
            $eventCalled = true;
        });
Home | Imprint | This part of the site doesn't use cookies.