diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f13e247..93f2196 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,7 @@ on: jobs: test: - name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }} + name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }} + Behat ${{ matrix.behat-version }} runs-on: ubuntu-latest continue-on-error: false strategy: @@ -25,11 +25,20 @@ jobs: - '7.4.*' - '8.0.*' - '8.1.*' + behat-version: + - stable + - 4.x-dev exclude: + # Symfony 8.x requires PHP >= 8.4 - php-version: '8.3' symfony-version: '8.0.*' - php-version: '8.3' symfony-version: '8.1.*' + # Behat 3.31 (stable) cannot install with Symfony 8.x + - behat-version: stable + symfony-version: '8.0.*' + - behat-version: stable + symfony-version: '8.1.*' steps: - name: Checkout uses: actions/checkout@v4 @@ -48,8 +57,8 @@ jobs: - name: Lock Symfony version run: VERSION=${{ matrix.symfony-version }} .github/workflows/lock-symfony-version.sh - - name: Require behat 4.x for Symfony 8+ - if: startsWith(matrix.symfony-version, '8.') + - name: Require behat 4.x + if: matrix.behat-version == '4.x-dev' run: | VERSION="4.x-dev as 3.31.0" .github/workflows/lock-behat-version.sh composer config minimum-stability dev @@ -62,9 +71,4 @@ jobs: run: vendor/bin/phpspec run -f pretty - name: Behat - run: | - if [[ "${{ matrix.symfony-version }}" == 8.* ]]; then - vendor/bin/behat --config behat.dist.php -fprogress --strict - else - vendor/bin/behat -fprogress --strict - fi + run: vendor/bin/behat --config behat.dist.php -fprogress --strict diff --git a/behat.yml.dist b/behat.yml.dist deleted file mode 100644 index aaee3cd..0000000 --- a/behat.yml.dist +++ /dev/null @@ -1,11 +0,0 @@ -default: - suites: - default: - path: "%paths.base%/features" - contexts: [Behat\MinkExtension\Context\MinkContext] - extensions: - Behat\MinkExtension\ServiceContainer\MinkExtension: - base_url: http://en.wikipedia.org/ - sessions: - default: - browserkit_http: ~ diff --git a/composer.json b/composer.json index ad78dd2..9aec045 100644 --- a/composer.json +++ b/composer.json @@ -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" ] } } diff --git a/src/Behat/MinkExtension/Listener/SessionsListener.php b/src/Behat/MinkExtension/Listener/SessionsListener.php index f2b87ae..ff80c66 100644 --- a/src/Behat/MinkExtension/Listener/SessionsListener.php +++ b/src/Behat/MinkExtension/Listener/SessionsListener.php @@ -11,7 +11,6 @@ namespace Behat\MinkExtension\Listener; use Behat\Behat\EventDispatcher\Event\ExampleTested; -use Behat\Behat\EventDispatcher\Event\ScenarioLikeTested; use Behat\Behat\EventDispatcher\Event\ScenarioTested; use Behat\Mink\Mink; use Behat\Testwork\EventDispatcher\Event\ExerciseCompleted; @@ -79,11 +78,11 @@ class SessionsListener implements EventSubscriberInterface * `@insulated` tag will cause Mink to stop current sessions before scenario * instead of just soft-resetting them * - * @param ScenarioLikeTested $event + * @param ScenarioTested $event * * @throws ProcessingException when the @javascript tag is used without a javascript session */ - public function prepareDefaultMinkSession(ScenarioLikeTested $event) + public function prepareDefaultMinkSession(ScenarioTested $event) { $scenario = $event->getScenario(); $feature = $event->getFeature(); diff --git a/src/Behat/MinkExtension/ServiceContainer/MinkExtension.php b/src/Behat/MinkExtension/ServiceContainer/MinkExtension.php index 6bb1e70..783e8d5 100644 --- a/src/Behat/MinkExtension/ServiceContainer/MinkExtension.php +++ b/src/Behat/MinkExtension/ServiceContainer/MinkExtension.php @@ -68,7 +68,7 @@ class MinkExtension implements ExtensionInterface $this->registerDriverFactory(new WebdriverClassicFactory()); } - public function registerDriverFactory(DriverFactory $driverFactory) + public function registerDriverFactory(DriverFactory $driverFactory): void { $this->driverFactories[$driverFactory->getDriverName()] = $driverFactory; } @@ -76,7 +76,7 @@ class MinkExtension implements ExtensionInterface /** * {@inheritDoc} */ - public function load(ContainerBuilder $container, array $config) + public function load(ContainerBuilder $container, array $config): void { if (isset($config['mink_loader'])) { $basePath = $container->getParameter('paths.base'); @@ -108,7 +108,7 @@ class MinkExtension implements ExtensionInterface /** * {@inheritDoc} */ - public function configure(ArrayNodeDefinition $builder) + public function configure(ArrayNodeDefinition $builder): void { // Rewrite keys to define a shortcut way without allowing conflicts with real keys $renamedKeys = array_diff( @@ -177,7 +177,7 @@ class MinkExtension implements ExtensionInterface /** * {@inheritDoc} */ - public function getConfigKey() + public function getConfigKey(): string { return 'mink'; } @@ -185,14 +185,14 @@ class MinkExtension implements ExtensionInterface /** * {@inheritdoc} */ - public function initialize(ExtensionManager $extensionManager) + public function initialize(ExtensionManager $extensionManager): void { } /** * {@inheritDoc} */ - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $this->processSelectors($container); }