KnpLabs / KnpLabs/php-github-api

Add ability to change default host

Đang mở
#1,148 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
PHP
Star
2.2k
Fork
587
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
php
Lĩnh vực
api
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.