Modernise for Behat ^3.31 and PHP ^8.3, drop Behat 3 / Symfony <7.4#44
Open
pamil wants to merge 4 commits into
Open
Modernise for Behat ^3.31 and PHP ^8.3, drop Behat 3 / Symfony <7.4#44pamil wants to merge 4 commits into
pamil wants to merge 4 commits into
Conversation
- Delete src/Behat3/ (docblock annotation version) and src/autoload.php version detector; move src/Behat310/ → src/ as the single code path - Add src/Config/ArrayConfig.php; thereIsConfiguration now writes behat.dist.php via ArrayConfig+var_export instead of YAML file or inline anonymous ConfigInterface class - Add replaceAnnotationsWithAttributes() to thereIsFile so old-style context files in feature scenarios are transparently upgraded - Drop md5() wrapper in thereIsFeatureFile, simplify Process constructor, collapse dead assertOutputMatches branch, fix getProcess() nullability - Add symfony/yaml ^7.4 to require; bump PHP to ^8.3, behat to ^3.31, symfony/* to ^7.4; switch autoload from files[] to PSR-4 - Collapse features/annotations/ and features/attributes/ → features/ (scenarios were identical, context snippets now use attributes only) - Remove behat.yml.dist; update behat.dist.php to point at features/ - Update CI: modern PHP/Symfony matrix (8.3-8.5 × 7.4/8.0/8.1), restrict push trigger to master, add behat 4.x step for SF 8+, add validate-composer job, drop old lowest/highest matrix - Add phpstan-bootstrap.php to declare BEHAT_BIN_PATH; fix phpstan errors Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…pers - thereIsConfiguration now writes content directly to behat.dist.php — callers supply valid PHP; no YAML parsing, no implicit conversion - Drop symfony/yaml from require and from CI lock step - Make $workingDir and $filesystem instance properties (set in beforeScenario); only $phpBin stays static — fixes scenario isolation and removes the remove-then-mkdir dance from beforeScenario - Reset $process to null in beforeScenario to prevent stale state - Collapse the four canned helpers to a single shared FeatureContext (writeSharedFeatureContext) that contains all steps — previously each helper wrote the same path, silently clobbering the previous one - Change getProcessExitCode fallback from -1 to 1 (treat not-yet-exited as failure rather than an invalid POSIX code) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Replace ArrayConfig with Behat\Config\Config — same ConfigInterface contract (constructor takes array, toArray() returns it), already a dependency; delete src/Config/ entirely - Replace PhpExecutableFinder with PHP_BINARY constant — always points to the running PHP binary, no filesystem search, reliable under version managers (phpenv, asdf); removes the BeforeFeature static hook and the static $phpBin property - Replace start()+wait() with run() — Process::run() is exactly that pair - Remove trailing slash from $workingDir to avoid double-slash in paths Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
src/Behat3/(docblock annotation version) andsrc/autoload.phpversion detector;src/Behat310/becomessrc/— single code path going forwardthereIsConfigurationnow writesbehat.dist.phpviaArrayConfig+var_exportinstead of a YAML file (behat 3) or an inline anonymousConfigInterfaceclass (behat 4) — works on both behat 3.31 and behat 4.xreplaceAnnotationsWithAttributes():thereIsFiletransparently converts/** @Given */docblocks in PHP context files to#[Given]attributes, so existing feature file scenarios using old-style context snippets keep working without duplication issues on behat 3.31+src/Config/ArrayConfig.phpimplementingConfigInterfacesymfony/yaml ^7.4to require (needed to parse YAML config strings from feature files); bump PHP to^8.3, behat to^3.31, symfony/* to^7.4; switch autoload fromfiles[]to PSR-4features/annotations/andfeatures/attributes/→features/(scenarios were identical; context snippets now use attributes only); deletebehat.yml.distphpstan-bootstrap.phpto declareBEHAT_BIN_PATH; fix all level-max errors; dropexcludePathsfor the now-deletedsrc/Behat3/Test plan
🤖 Generated with Claude Code