From 9b9034855bd013fb8f2eeed2e7f04127bd45a659 Mon Sep 17 00:00:00 2001 From: Jose Lopes Date: Thu, 24 Mar 2022 19:40:34 +0000 Subject: [PATCH 1/3] Easy fix for when Reflection parameter throws an exception in new version --- .../MinkExtension/ServiceContainer/Driver/GoutteFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php index fb10d889..640dbcb9 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php @@ -68,10 +68,10 @@ public function buildDriver(array $config) ); } - if ($this->isGoutte1()) { - $guzzleClient = $this->buildGuzzle3Client($config['guzzle_parameters']); - } elseif ($this->isGuzzle6()) { + if ($this->isGuzzle6()) { $guzzleClient = $this->buildGuzzle6Client($config['guzzle_parameters']); + } elseif ($this->isGoutte1()) { + $guzzleClient = $this->buildGuzzle3Client($config['guzzle_parameters']); } else { $guzzleClient = $this->buildGuzzle4Client($config['guzzle_parameters']); } From a16699c2b8ab59ec309645d7ec9cf91d36d0a739 Mon Sep 17 00:00:00 2001 From: Jose Lopes Date: Thu, 24 Mar 2022 19:57:25 +0000 Subject: [PATCH 2/3] Fix usage of the new Goutte client --- .../ServiceContainer/Driver/GoutteFactory.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php index 640dbcb9..a34a6611 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php @@ -70,7 +70,12 @@ public function buildDriver(array $config) if ($this->isGuzzle6()) { $guzzleClient = $this->buildGuzzle6Client($config['guzzle_parameters']); - } elseif ($this->isGoutte1()) { + $clientDefinition = new Definition('Behat\Mink\Driver\Goutte\Client', array($guzzleClient)); + + return new Definition('Behat\Mink\Driver\GoutteDriver', array($clientDefinition)); + } + + if ($this->isGoutte1()) { $guzzleClient = $this->buildGuzzle3Client($config['guzzle_parameters']); } else { $guzzleClient = $this->buildGuzzle4Client($config['guzzle_parameters']); From 6b71d19dd8b648a254dbb4a2dd7a37c913221ca9 Mon Sep 17 00:00:00 2001 From: Jose Lopes Date: Thu, 24 Mar 2022 22:45:06 +0000 Subject: [PATCH 3/3] Remove the guzzle client as is not supported by the new fabpot. Symfony Http interface expected --- .../MinkExtension/ServiceContainer/Driver/GoutteFactory.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php index a34a6611..b6b8a28e 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php @@ -69,8 +69,7 @@ public function buildDriver(array $config) } if ($this->isGuzzle6()) { - $guzzleClient = $this->buildGuzzle6Client($config['guzzle_parameters']); - $clientDefinition = new Definition('Behat\Mink\Driver\Goutte\Client', array($guzzleClient)); + $clientDefinition = new Definition('Behat\Mink\Driver\Goutte\Client'); return new Definition('Behat\Mink\Driver\GoutteDriver', array($clientDefinition)); }