Skip to content

Commit

Permalink
Fix guzzle connect timeout parameter index
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Jul 9, 2021
1 parent 115e34f commit 7b9ba53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ConfigFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct($sdkKey, LoggerInterface $logger, array $options = [
? $options['request-options']
: [];

if (!isset($additionalOptions['connect-timeout'])) {
if (!isset($additionalOptions['connect_timeout'])) {
$additionalOptions['connect_timeout'] = 10;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/ConfigFetcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ public function testConstructDefaults()
$fetcher = new ConfigFetcher("api", new NullLogger());
$options = $fetcher->getRequestOptions();

$this->assertEquals(10, $options['connect-timeout']);
$this->assertEquals(10, $options['connect_timeout']);
$this->assertEquals(30, $options['timeout']);
$this->assertArrayHasKey("headers", $options);
}

public function testConstructConnectTimeoutOption()
{
$fetcher = new ConfigFetcher("api", new NullLogger(), ['request-options' => [
'connect-timeout' => 5
'connect_timeout' => 5
]]);
$options = $fetcher->getRequestOptions();
$this->assertEquals(5, $options['connect-timeout']);
$this->assertEquals(5, $options['connect_timeout']);
}

public function testConstructRequestTimeoutOption()
Expand Down

0 comments on commit 7b9ba53

Please sign in to comment.