Closed Berdir closed 10 years ago
Note:
Testing this with Drupal/drupal-extension, which currently has "behat/mink": "1.5.*@stable", in it's require. Which means mink-extension 1.2, and it that version, you also need to update goutte.xml like this:
diff --git a/src/Behat/MinkExtension/services/sessions/goutte.xml b/src/Behat/MinkExtension/services/sessions/goutte.xml
index 6f003fc..9ab06a9 100644
--- a/src/Behat/MinkExtension/services/sessions/goutte.xml
+++ b/src/Behat/MinkExtension/services/sessions/goutte.xml
@@ -6,7 +6,7 @@
<parameter key="behat.mink.driver.goutte.class">Behat\Mink\Driver\GoutteDriver</parameter>
<parameter key="behat.mink.goutte.class">Behat\Mink\Driver\Goutte\Client</parameter>
- <parameter key="behat.mink.guzzle.class">Guzzle\Http\Client</parameter>
+ <parameter key="behat.mink.guzzle.class">GuzzleHttp\Client</parameter>
<parameter key="behat.mink.goutte.server_parameters" type="collection"></parameter>
<parameter key="behat.mink.goutte.guzzle_parameters" type="collection"></parameter>
@@ -31,7 +31,6 @@
</service>
<service id="behat.mink.guzzle" class="%behat.mink.guzzle.class%">
- <argument>null</argument>
<argument>%behat.mink.goutte.guzzle_parameters%</argument>
</service>
But mink-extension 2.0 doesn't have those fails anymore, so not sure yet what to do.
I won't merge this until Goutte itself is settled on a strategy to upgrade Goutte
I won't merge this until Goutte itself is settled on a strategy to upgrade Goutte
You meant, I won't merge this until Goutte itself is settled on a strategy to upgrade Guzzle
maybe, @stof?
Sure, is not possible before anyway as we'll need Goutte to be updated to get the tests working.
Just wanted to get this in the open and maybe some early feedback, for example on how to deal with the mink-extension problem? Should drupalextension use a newer mink version now?
@Berdir there won't be any issue for MinkExtension either, because the new Goutte version will be a new major version because of the BC break, so the composer constraint will deal of the compatibility issues for us. Once we have a Goutte v2, we will be able to migrate to the v2 of Goutte for the Mink layer.
@stof: Sorry, I don't get what you mean. What I mean is that MinkExtension also needs to be updated, but there are multiple versions... drupalextension is still running against 1.2, which has it in an XML file (https://github.com/Behat/MinkExtension/blob/1.2/src/Behat/MinkExtension/services/sessions/goutte.xml) while 2.0 has it in a factory class (https://github.com/Behat/MinkExtension/blob/2.0/src/Behat/MinkExtension/ServiceContainer/Driver/GoutteFactory.php), I'm not sure now which version to continue with and if 2.0, how we get drupalextension to use that.
FYI, Goutte 2.0 with Guzzle 4 support is now out.
Awesome, updated the composer file accordingly!
Still lost as to how to deal with mink-extension factory/container definitions...
:+1:
I will look at this this weekend, to see how we can handle the configuration of Goutte in MinkExtension and the overwrite of a Goutte method here without dropping support for Goutte 1.x entirely (for BC reasons in the driver). It is too late to do such task this evening
@Berdir I opened a Pr with a different approach allowing to support both Goutte versions together in GoutteDriver, which is much better. This way, we don't need to create a new major version because of the Goutte upgrade. We can keep a single version. I'm closing this PR in favor of #43
@Berdir FYI, I allowed Goutte 2.x in the config. However, MinkExtension 1.3 (for Behat 2.5) does not support using Goutte 2.0 (in 1.3.3, it throws an exception when configuring the driver instead of giving a fatal error later). Using Goutte 2.0 in MinkGoutteDriver with Behat will be possible only in MinkExtension 2.0 (which is for Behat 3)
Great, sounds good. I guess I can patch minkextension for now, will look what switching to Behat 3 would mean for drupalexension.
@Berdir It would be great to provide a branch of DrupalExtension compatible with Behat 3, given that it is the stable version now. this will require some work in the extension itself to adapt it (Behat internals have been rewritten from scratch approximately), but it should not make lots of changes for users except for the config. If you need help for the upgrade, you can ask me (but in a different place that this issue tracker, where it is quite off topic)
See https://github.com/fabpot/Goutte/pull/140