Skip to content

Commit

Permalink
Added support for client configuration when using BrowserKit
Browse files Browse the repository at this point in the history
  • Loading branch information
BastienGarcia committed Jul 21, 2023
1 parent ffc5ee8 commit 6477bb6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ public function buildDriver(array $config)
throw new \RuntimeException(sprintf('Class %s not found, did you install symfony/browser-kit 4.4+?', HttpBrowser::class));
}

$parameters[] = $config['http_client_parameters'] ?? [];

$httpClientDefinition = new Definition(null, $parameters);
$httpClientDefinition->setFactory(HttpClient::class.'::create');

return new Definition(BrowserKitDriver::class, [
new Definition(HttpBrowser::class),
new Definition(HttpBrowser::class, [
$httpClientDefinition,
]),
'%mink.base_url%',
]);
}
Expand Down

0 comments on commit 6477bb6

Please sign in to comment.