Merge pull request #22 from BastienGarcia/master

Added support for client configuration when using BrowserKit
This commit is contained in:
Yozhef
2023-09-12 12:50:10 +03:00
committed by GitHub
2 changed files with 10 additions and 3 deletions

View File

@@ -6,11 +6,11 @@ Feature: Search
Scenario: Searching for a page that does exist
Given I am on "/wiki/Main_Page"
When I fill in "search" with "Behavior Driven Development"
And I press "searchButton"
And I press "Search"
Then I should see "agile software development"
Scenario: Searching for a page that does NOT exist
Given I am on "/wiki/Main_Page"
When I fill in "search" with "Glory Driven Development"
And I press "searchButton"
And I press "Search"
Then I should see "Search results"

View File

@@ -56,8 +56,15 @@ class BrowserKitFactory implements DriverFactory
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%',
]);
}