Repository navigation
Conversation
The API does not use redirects. The API client followed them all the same. Disable redirects for all API requests, so each request goes only to the configured API host. Set a timeout of 10 seconds.
buchmarv
requested changes
Nov 20, 2026
|
|
||
| #[Test] | ||
| public function getRequestOptionsReturnsTrueByDefault(): void | ||
| public function getRequestOptionsVerifiesSslByDefault(): void |
There was a problem hiding this comment.
If the test is about verify SSL, don't compare the full array, but only the verify key. Otherwise each update of request options would require updating this test, although nothing changed regarding its purpose.
| public function getRequestOptionsDisablesSslVerificationWhenConfigured(): void | ||
| { | ||
| self::assertSame(['verify' => false], $this->buildSubject(verifySsl: '0')->getRequestOptions()); | ||
| self::assertSame(['verify' => false, 'allow_redirects' => false, 'timeout' => 10], $this->buildSubject(verifySsl: '0')->getRequestOptions()); |
There was a problem hiding this comment.
If the test is about verify SSL, don't compare the full array, but only the verify key. Otherwise each update of request options would require updating this test, although nothing changed regarding its purpose.
| } | ||
|
|
||
| // The response for the redirect target stays in the queue: the client sends only one request. | ||
| self::assertCount(1, $this->mockHandler); |
There was a problem hiding this comment.
I'd prefer checking the client's final URL over relying on a non-empty stack. 🤔
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The API does not use redirects. The API client followed them all the same.
Disable redirects for all API requests, so each request goes only to the configured API host. Set a timeout of 10 seconds.