Merge pull request #22 from BastienGarcia/master
Added support for client configuration when using BrowserKit
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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%',
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user