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