KnpLabs / KnpLabs/php-github-api
Add ability to change default host
- 主要语言
- PHP
- 星标
- 2.2k
- 派生
- 587
- PR 合并指标
- 30 天内没有已合并 PR
描述
For the testing purposes I need to change `https://api.github.com` host to the mock API url, but there is no way to do it. All auto-tests should go to the mock service, instead of real GitHub.
We can use enterprise url as a workaround, but it looks like a wrong path.
I see 3 ways to implement this feature:
1. Check in `Github\Client::__construct` method if `AddHostPlugin` already defined, and skip it's definition in this case. Set enterprise URL will require the same check.
2. Add method to change host plugin manually in `Github\Client` object.
3. Make `Github\Client::getHttpClientBuilder` public.
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start at Github\Client::__construct and Github\Client::getHttpClientBuilder, then inspect how AddHostPlugin and the enterprise URL are configured. Decide how callers can set a mock host without sending requests to real GitHub, and verify that the client’s requests use the configured host.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- api
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100