Skip to content

Commit

Permalink
Allow to pass variables/arrays to manager options and not just scalar…
Browse files Browse the repository at this point in the history
… values
  • Loading branch information
robertfausk committed Mar 30, 2021
1 parent 3ebdb9d commit 160da02
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ServiceContainer/PantherConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function addManagerOptionsNode(): ArrayNodeDefinition
"These are the options passed as third argument to PantherTestCaseTrait::createPantherClient client constructor."
)
->ignoreExtraKeys()
->scalarPrototype()
->variablePrototype()
->end()
;

Expand Down
35 changes: 35 additions & 0 deletions tests/Unit/PantherConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,41 @@ public function test_processed_configuration(): void
);
}

public function test_processed_configuration_for_manager_options(): void
{
$this->assertProcessedConfigurationEquals(
[
[
'manager_options' => [
'connection_timeout_in_ms' => '5000',
'request_timeout_in_ms' => '120000',
'capabilities' => [
'goog:chromeOptions' => [
'prefs' => [
'download.default_directory' => '/var/www/html/tests/files/Downloads',
],
],
],
],
],
],
[
'manager_options' => [
'connection_timeout_in_ms' => '5000',
'request_timeout_in_ms' => '120000',
'capabilities' => [
'goog:chromeOptions' => [
'prefs' => [
'download.default_directory' => '/var/www/html/tests/files/Downloads',
],
],
],
],
],
'manager_options'
);
}

protected function getConfiguration(): PantherConfiguration
{
return new PantherConfiguration();
Expand Down

0 comments on commit 160da02

Please sign in to comment.