Add behat-version matrix dimension, fix Behat 4 type errors, unify config

CI matrix now has a behat-version dimension (stable / 4.x-dev) so both
Behat 3.31 and Behat 4 are tested explicitly. Symfony 8.x rows always
use Behat 4; Symfony 7.4 rows test both versions.

behat.dist.php works with Behat 3.31 too (Behat\Config\Config exists as
a bridge since 3.31), so drop behat.yml.dist and always use the PHP
config — removes the if/else branch from CI and unifies local dev too.

SessionsListener: fix type hint on prepareDefaultMinkSession from
ScenarioLikeTested to ScenarioTested — the method uses getSuite() which
is on LifecycleEvent (not ScenarioLikeTested), and the dispatched events
are ScenarioTested subclasses. Also remove now-unused ScenarioLikeTested
import.

ServiceContainer/MinkExtension: add missing return types (: string,
: void) to all interface method overrides to satisfy Behat 4's stricter
interface signatures.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kamil Kokot
2026-06-12 17:15:15 +02:00
parent e7f7e3508a
commit a1355134df
5 changed files with 22 additions and 30 deletions

View File

@@ -48,7 +48,7 @@
"scripts": {
"test": [
"vendor/bin/phpspec run -f pretty",
"vendor/bin/behat -fprogress --strict"
"vendor/bin/behat --config behat.dist.php -fprogress --strict"
]
}
}