Skip to content

Commit

Permalink
MDL-78934 behat: Move from mink goutte to browserkit driver
Browse files Browse the repository at this point in the history
In order to get compatibility with PHP 8.1 there are 2 options:

1) Move to the Goutte 2 mink driver, that uses Goutte 4.
2) Move to the BrowserKit mink driver.

While 1) could sound like the easier alternative, and that is
what we are doing right now, there are a few points to take into consideration.

a) Goutte 4 is a complete wrapper over BrowserKit. 100%. See its
   source code: https://github.com/FriendsOfPHP/Goutte/blob/master/Goutte/Client.php
b) The mink extension still doesn't support Goutte 4, but supports
   BrowserKit. See https://github.com/FriendsOfBehat/MinkExtension (PR#16)
   (we could workaround this by forking the package again)
c) Last, but not least, recently (June 2023) both the MinkGoutteDriver
   and Goutte itself have been archived/abandoned:
   - https://packagist.org/packages/behat/mink-goutte-driver
   - https://packagist.org/packages/fabpot/goutte

So, given the points above, this is an attempt to move away
completely from Goutte and straight use the BrowserKit alternative
that, in practice, is the very same code that we are already using
(you can see that, in the .lock changes there isn't any new thing
being installed, because, as said, we are using it already).

Let's see how complex it is, I imagine it won't be hard. Surely killing
all references everywhere about Goutte will be the most complex task.
  • Loading branch information
stronk7 committed Aug 18, 2023
1 parent e998f14 commit 11b7ff6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 125 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"mikey179/vfsstream": "1.6.*",
"behat/mink": "^1.10.0",
"friends-of-behat/mink-extension": "^2.7.2",
"behat/mink-goutte-driver": "^2.0",
"behat/mink-browserkit-driver": "^2.1.0",
"symfony/process": "^4.4 || ^5.0 || ^6.0",
"symfony/http-client": "^4.4 || ^5.0 || ^6.0",
"symfony/mime": "^4.4 || ^5.0 || ^6.0",
"behat/behat": "3.13.*",
"oleg-andreyev/mink-phpwebdriver": "1.2.*"
},
Expand Down
131 changes: 7 additions & 124 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 11b7ff6

Please sign in to comment.