'/foo']); /** @var Authenticator|MockObject $auth */ $auth = $this->createMock(Authenticator::class); $this->setExpects($auth, 'user', null, true); /** @var Redirector|MockObject $redirect */ $redirect = $this->createMock(Redirector::class); $this->setExpects($redirect, 'to', ['/foo'], new Response()); $controller = new HomeController($auth, $config, $redirect); $controller->index(); } }