<?php

namespace Behat\Mink\Tests\Driver;

use Behat\Mink\Driver\BrowserKitDriver;
use Behat\Mink\Tests\Driver\Util\FixturesKernel;
use Symfony\Component\HttpKernel\Client;

class BrowserKitConfig extends AbstractConfig
{
    public static function getInstance()
    {
        return new self();
    }

    /**
     * {@inheritdoc}
     */
    public function createDriver()
    {
        $client = new Client(new FixturesKernel());

        return new BrowserKitDriver($client);
    }

    /**
     * {@inheritdoc}
     */
    public function getWebFixturesUrl()
    {
        return 'http://localhost';
    }

    protected function supportsJs()
    {
        return false;
    }

    public function skipMessage($testCase, $test)
    {
        if (
            'Behat\Mink\Tests\Driver\Form\Html5Test' === $testCase
            && in_array($test, array(
                'testHtml5FormAction',
                'testHtml5FormMethod',
            ))
            && !method_exists('Symfony\Component\DomCrawler\Tests\FormTest', 'testGetMethodWithOverride')
        ) {
            return 'Mink BrowserKit doesn\'t support HTML5 form attributes before Symfony 3.3';
        }

        return parent::skipMessage($testCase, $test);
    }
}

<?php

namespace Behat\Mink\Tests\Driver;

use Behat\Mink\Driver\BrowserKitDriver;
use Behat\Mink\Tests\Driver\Util\FixturesKernel;
use Symfony\Component\HttpKernel\Client;

class BrowserKitConfig extends AbstractConfig
{
    public static function getInstance()
    {
        return new self();
    }

    /**
     * {@inheritdoc}
     */
    public function createDriver()
    {
        $client = new Client(new FixturesKernel());

        return new BrowserKitDriver($client);
    }

    /**
     * {@inheritdoc}
     */
    public function getWebFixturesUrl()
    {
        return 'http://localhost';
    }

    protected function supportsJs()
    {
        return false;
    }

    public function skipMessage($testCase, $test)
    {
        if (
            'Behat\Mink\Tests\Driver\Form\Html5Test' === $testCase
            && in_array($test, array(
                'testHtml5FormAction',
                'testHtml5FormMethod',
            ))
            && !method_exists('Symfony\Component\DomCrawler\Tests\FormTest', 'testGetMethodWithOverride')
            // Symfony 4.4 removed tests from dist archives, making the previous detection return a false-positive
            && !method_exists('Symfony\Component\DomCrawler\Form', 'getName')
        ) {
            return 'Mink BrowserKit doesn\'t support HTML5 form attributes before Symfony 3.3';
        }

        return parent::skipMessage($testCase, $test);
    }
}

Fix the detection of HTML5 support in the testsuite
Fix the detection of HTML5 support in the testsuite

The detection relied on detecting the test method added when introducing
the feature in symfony/dom-crawler. But as of Symfony 4.4, tests are
stripped from the dist archives. An additional detection based on a new
method added in later Symfony version is now used to filter out the
false positives (not detecting 4.4 and newer as being <3.3).
