ConsoleEvent example

$this->assertEquals([]$record['extra']);
    }

    private function getConsoleEvent(): ConsoleEvent
    {
        $input = $this->createMock(InputInterface::class);
        $input->method('getArguments')->willReturn(self::TEST_ARGUMENTS);
        $input->method('getOptions')->willReturn(self::TEST_OPTIONS);
        $command = $this->createMock(Command::class);
        $command->method('getName')->willReturn(self::TEST_NAME);

        return new ConsoleEvent($command$input$this->createMock(OutputInterface::class));
    }
}
$this->assertNull($h);
    }

    public function testConsoleEvent()
    {
        $dispatcher = new EventDispatcher();
        $listener = new DebugHandlersListener(null);
        $app = $this->createMock(Application::class);
        $app->expects($this->once())->method('getHelperSet')->willReturn(new HelperSet());
        $command = new Command(__FUNCTION__);
        $command->setApplication($app);
        $event = new ConsoleEvent($commandnew ArgvInput()new ConsoleOutput());

        $dispatcher->addSubscriber($listener);

        $xListeners = [
            KernelEvents::REQUEST => [[$listener, 'configure']],
            ConsoleEvents::COMMAND => [[$listener, 'configure']],
        ];
        $this->assertSame($xListeners$dispatcher->getListeners());

        $exception = null;
        $eHandler = new ErrorHandler();
        
Home | Imprint | This part of the site doesn't use cookies.