Skip to content

Commit 7d8d038

Browse files
committed
Skip tests if Symfony DomCrawler version is too low. Smells like an horrible hack :/
1 parent 9331df9 commit 7d8d038

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/BrowserKitConfig.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Behat\Mink\Driver\BrowserKitDriver;
66
use Behat\Mink\Tests\Driver\Util\FixturesKernel;
7+
use Symfony\Component\DomCrawler\Tests\FormTest;
78
use Symfony\Component\HttpKernel\Client;
89

910
class BrowserKitConfig extends AbstractConfig
@@ -35,4 +36,20 @@ protected function supportsJs()
3536
{
3637
return false;
3738
}
39+
40+
public function skipMessage($testCase, $test)
41+
{
42+
if (
43+
'Behat\Mink\Tests\Driver\Form\Html5Test' === $testCase
44+
&& in_array($test, array(
45+
'testHtml5FormAction',
46+
'testHtml5FormMethod',
47+
))
48+
&& !method_exists(FormTest::class, 'testGetMethodWithOverride')
49+
) {
50+
return 'Mink BrowserKit doesn\'t support HTML5 form attributes before Symfony 3.3';
51+
}
52+
53+
return parent::skipMessage($testCase, $test);
54+
}
3855
}

0 commit comments

Comments
 (0)