KnpLabs / KnpLabs/php-github-api

Add ability to change default host

Aberta
#1,148 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
PHP
Estrelas
2.2k
Forks
587
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
php
Domínio
api
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.