diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php index 9b0e8d3..3d3ea6e 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserKitFactory.php @@ -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%', ]); }