From 160da0265b64001a183f6d2558442a45bb8b2c22 Mon Sep 17 00:00:00 2001 From: robertfausk Date: Tue, 30 Mar 2021 14:40:02 +0200 Subject: [PATCH] Allow to pass variables/arrays to manager options and not just scalar values --- src/ServiceContainer/PantherConfiguration.php | 2 +- tests/Unit/PantherConfigurationTest.php | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/ServiceContainer/PantherConfiguration.php b/src/ServiceContainer/PantherConfiguration.php index 86814e1..2820b7f 100644 --- a/src/ServiceContainer/PantherConfiguration.php +++ b/src/ServiceContainer/PantherConfiguration.php @@ -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() ; diff --git a/tests/Unit/PantherConfigurationTest.php b/tests/Unit/PantherConfigurationTest.php index bfb1458..6f3fb37 100644 --- a/tests/Unit/PantherConfigurationTest.php +++ b/tests/Unit/PantherConfigurationTest.php @@ -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();