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