Skip to content

Commit

Permalink
Move mock_ options out of default_options and update tests accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
tarjei committed May 12, 2024
1 parent 12fab44 commit 776e650
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1864,17 +1864,16 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e
->info('Rate limiter name to use for throttling requests')
->end()
->append($this->createHttpClientRetrySection())
->booleanNode('mock_client')
->info('Inject a mock client.')
->defaultFalse()
->end()
->scalarNode('mock_response_factory')
->defaultNull()
->info('The id of the service that should generate mock responses. It should be either an invokable or an iterable. Requires mock_client = true')
->end()
->end()
->end()

->booleanNode('mock_client')
->info('Inject a mock client.')
->defaultFalse()
->end()
->scalarNode('mock_response_factory')
->defaultNull()
->info('The id of the service that should generate mock responses. It should be either an invokable or an iterable. Requires mock_client = true')
->end()
->arrayNode('scoped_clients')
->useAttributeAsKey('name')
->normalizeKeys(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public function testScopedHttpClientsInheritRateLimiterAndRetryFailedConfigurati

$config = $processor->processConfiguration($configuration, [[
'http_client' => [
'default_options' => ['rate_limiter' => 'default_limiter', 'retry_failed' => ['max_retries' => 77], 'mock_response_factory' => null, 'mock_client' => false],
'default_options' => ['rate_limiter' => 'default_limiter', 'retry_failed' => ['max_retries' => 77]],
'scoped_clients' => [
'foo' => ['base_uri' => 'http://example.com'],
'bar' => ['base_uri' => 'http://example.com', 'rate_limiter' => true, 'retry_failed' => true],
Expand Down Expand Up @@ -808,6 +808,8 @@ class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphor
'disallow_search_engine_index' => true,
'http_client' => [
'enabled' => !class_exists(FullStack::class) && class_exists(HttpClient::class),
'mock_client' => false,
'mock_response_factory' => null,
'scoped_clients' => [],
],
'mailer' => [
Expand Down

0 comments on commit 776e650

Please sign in to comment.