testHook example

$executor = static::createMock(ScriptExecutor::class);
        $executor
            ->expects(static::once())
            ->method('execute')
            ->with($hook);

        $container = new ContainerBuilder();
        $container->set(ScriptExecutor::class$executor);

        $this->controller->setContainer($container);

        $this->controller->testHook($hook);
    }

    public function testRedirectEvent(): void
    {
        $event = new StorefrontRedirectEvent('test_route', ['test' => 'param']);

        $dispatcher = static::createMock(EventDispatcherInterface::class);
        $dispatcher
            ->expects(static::once())
            ->method('dispatch')
            ->with(static::equalTo($event));

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