Skip to content

maint: Support Behat 4.0#56

Open
acoulton wants to merge 5 commits into
FriendsOfBehat:masterfrom
acoulton:maint-behat4-support
Open

maint: Support Behat 4.0#56
acoulton wants to merge 5 commits into
FriendsOfBehat:masterfrom
acoulton:maint-behat4-support

Conversation

@acoulton

Copy link
Copy Markdown

Now that Behat 4.0.0-alpha1 has been release, add official support for Behat 4.0.

Also updates deprecations to use the official deprecation mechanism for Behat extensions, and updates docs to show how to configure the extension using Behat's PHP config (which is required from 4.0 onwards).

acoulton added 3 commits June 22, 2026 22:50
And simplify the CI scripts for installing Behat. Now that there
is an official 4.0-alpha1 release, we can use composer's built-in
`--with {package}:{version}` to specify which Behat version to
install. This also has the advantage that composer enforces that
the requested version fits within the constraint specified by the
actual composer.json.

Added the `@alpha` tag to the behat version in composer.json
itself - this will enforce that CI only installs the Behat alpha
release but requires stable releases of all other packages.
This also guarantees the called method is present (with the expected signature).
This avoids the risk that an unexpected / incompatible version of `symfony/deprecation-contracts` is installed - since 2d50420 this package does
not have an explicit dependency on symfony/deprecation-contracts and only
assumes that a suitable version will be installed as a transitive dependency.
Behat is dropping support for YAML, and PHP config is available
in all the versions MinkExtension now supports.
This was referenced Jun 22, 2026
public function buildDriver(array $config): Definition
{
trigger_deprecation('friends-of-behat/mink-extension', '2.8.0', 'Configuration for the "sahi" driver is deprecated, since the client implementation has been abandoned. Support for it will be removed in the next major version of this extension.');
DeprecationCollector::trigger('Configuration for the "sahi" driver is deprecated, since the client implementation has been abandoned. Support for it will be removed in the next major version of MinkExtension.');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous deprecation using symfony/deprecation-contracts would mention that this deprecation comes from friends-of-behat/mink-extension since version 2.8.0. Your change loses that info.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed.

acoulton added 2 commits June 23, 2026 09:09
The `--with` argument is only available for composer update,
not composer install. Since there is no lockfile, these commands
behave the same.

- name: Install dependencies
run: composer install --prefer-dist --no-progress
run: composer update --prefer-dist --no-progress --with behat/behat:"${{ matrix.behat-version }}"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed switching this from composer install to composer update originally, which broke CI. Fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants