Add support for Symfony 8 and Behat 4 - #233
Merged
Merged
Conversation
behat 3.x does not support Symfony 8+. A conditional workflow step patches the behat/behat constraint to 4.x-dev@dev for Symfony 8+ jobs only, keeping the main composer.json on the stable ^3.22 constraint. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…SF 8.1 - Use inline alias "4.x-dev@dev as 3.31.0" so behat 4.x satisfies the ^3.x constraints of friends-of-behat/* packages without removing them - Exclude PHP 8.3 + Symfony 8.1 from the matrix since SF 8.1 requires PHP >=8.4.1 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Drop the @dev stability flag from the inline alias (it caused Composer to treat it as an exact version match rather than an alias), and explicitly set minimum-stability=dev + prefer-stable=true so the 4.x-dev branch is resolvable. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ility Behat 4.x dropped YAML config and docblock annotations entirely: - Add behat.dist.php (PHP config format behat 4.x requires) - Add tests/Behat/Config/ArrayConfig.php to wrap merged YAML arrays as ConfigInterface for subprocess behat.dist.php generation - Update TestContext to write both YAML (behat 3.x) and PHP (behat 4.x) configs in thereIsConfiguration, updated incrementally on each call - Add PHP 8 step/hook attributes alongside existing docblock annotations in thereIsFile so embedded context classes work under behat 4.x - Resolve behat 3.x short extension names to full class names in the PHP config (behat 4.x requires FQCNs) - Exclude mink_integration and fob_page_object_integration from Symfony 8+ CI runs (those extensions do not yet support behat 4.x) - Also exclude PHP 8.3 + Symfony 8.0 (Symfony 8.0 requires PHP >=8.4) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… only - Bump behat to ^3.31 (first version with both PHP 8 attr and PHP config support) - Replace all short extension names in feature files with FQCNs so no name resolution is needed in TestContext - TestContext: single code path for behat 3.31 and 4.x — no isBehat4 detection, no behat3Imports, no resolveExtensionClass map - thereIsConfiguration: writes only behat.dist.php (PHP config); both behat 3.31 and 4.x can read it, with behat.yml.dist taking priority for the outer run in behat 3.31 - thereIsFile: always replaces @Given/@When/@then docblocks with PHP 8 attributes so subprocess context classes work identically under both - Also exclude PHP 8.3 + Symfony 8.0 from CI matrix (SF 8.0 requires PHP >=8.4) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
friends-of-behat/service-container-extension uses XmlFileLoader which was removed in Symfony 8. Exclude the three affected sanity_checks feature files instead of the whole directory. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Thomas Baccelli <thomasbaccelli@tabesto.com>
GSadee
marked this pull request as draft
July 13, 2026 12:14
GSadee
force-pushed
the
symfony-8-behat-4
branch
from
July 15, 2026 13:00
87c444a to
2e87be3
Compare
GSadee
marked this pull request as ready for review
July 15, 2026 13:06
Co-authored-by: shahinataei-ts <shahin.ataei@ticketswap.com> Co-authored-by: Maximilian Graf Schimmelmann <max@schimmelmann.org>
Co-authored-by: Hugo Alliaume <hugo@alliau.me> Co-authored-by: shahinataei-ts <shahin.ataei@ticketswap.com> Co-authored-by: Pascal CESCON - Amoifr <pascal.cescon@gmail.com>
GSadee
force-pushed
the
symfony-8-behat-4
branch
from
July 16, 2026 11:42
e2dfd49 to
0dbda8c
Compare
NoResponseMate
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #229 and partially based on #232.
Supersedes the other Symfony 8 / Behat 4 attempts: #218, #219 and #221 (composer constraint bumps), and #222 (Symfony 8 adaptation).
Thanks to @pamil, @atomiix, @Kocal, @shahinataei-ts, @Amoifr and @bytes-max for the earlier work this builds on.