BrowserKitConfig.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Behat\Mink\Tests\Driver;
  3. use Behat\Mink\Driver\BrowserKitDriver;
  4. use Behat\Mink\Tests\Driver\Util\FixturesKernel;
  5. use Symfony\Component\HttpKernel\Client;
  6. class BrowserKitConfig extends AbstractConfig
  7. {
  8. public static function getInstance()
  9. {
  10. return new self();
  11. }
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function createDriver()
  16. {
  17. $client = new Client(new FixturesKernel());
  18. return new BrowserKitDriver($client);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function getWebFixturesUrl()
  24. {
  25. return 'http://localhost';
  26. }
  27. protected function supportsJs()
  28. {
  29. return false;
  30. }
  31. public function skipMessage($testCase, $test)
  32. {
  33. if (
  34. 'Behat\Mink\Tests\Driver\Form\Html5Test' === $testCase
  35. && in_array($test, array(
  36. 'testHtml5FormAction',
  37. 'testHtml5FormMethod',
  38. ))
  39. && !method_exists('Symfony\Component\DomCrawler\Tests\FormTest', 'testGetMethodWithOverride')
  40. ) {
  41. return 'Mink BrowserKit doesn\'t support HTML5 form attributes before Symfony 3.3';
  42. }
  43. return parent::skipMessage($testCase, $test);
  44. }
  45. }