Skip to content

Commit 7c45c64

Browse files
authored
Merge pull request #123 from sroze/symfony-4-support
Symfony 4 support
2 parents 1c9c8ad + fd77370 commit 7c45c64

5 files changed

Lines changed: 38 additions & 17 deletions

File tree

.travis.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,36 @@ language: php
22

33
sudo: false
44

5-
php: [5.3, 5.4, 5.5, 5.6, 7.0, 7.1, hhvm]
5+
php: [5.4, 5.5, 5.6, 7.0, 7.1, hhvm]
66

77
matrix:
88
include:
9+
- php: 5.3
10+
dist: precise
911
# Test against LTS versions
10-
- php: 5.5
11-
env: SYMFONY_VERSION='2.3.*'
12-
- php: 5.5
13-
env: SYMFONY_VERSION='2.7.*'
14-
- php: 5.6
15-
env: SYMFONY_VERSION='2.8.*'
12+
- php: 7.1
13+
env: SYMFONY_VERSION='^2'
14+
- php: 7.1
15+
env: SYMFONY_VERSION='^3'
1616
# Test against dev versions of dependencies
17-
- php: 5.6
17+
- php: 7.1
1818
env: DEPENDENCIES='dev'
1919

2020
cache:
2121
directories:
2222
- $HOME/.composer/cache/files
23+
- $HOME/symfony-bridge/.phpunit
2324

2425
before_install:
25-
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
26-
- sh -c 'if [ "$SYMFONY_VERSION" != "" ]; then composer require -n --no-update symfony/symfony=$SYMFONY_VERSION; fi;'
26+
- if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi;
27+
- sh -c 'if [ "$SYMFONY_VERSION" != "" ]; then composer require -n --no-update symfony/lts=$SYMFONY_VERSION; fi;'
2728

2829
install:
2930
- composer install -n
31+
- vendor/bin/simple-phpunit install
3032

31-
script: phpunit -v --coverage-clover=coverage.clover
33+
script: vendor/bin/simple-phpunit -v --coverage-clover=coverage.clover
3234

3335
after_script:
34-
- wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover
36+
- wget https://scrutinizer-ci.com/ocular.phar
37+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
"require": {
1818
"php": ">=5.3.6",
1919
"behat/mink": "^1.7.1@dev",
20-
"symfony/browser-kit": "~2.3|~3.0",
21-
"symfony/dom-crawler": "~2.3|~3.0"
20+
"symfony/browser-kit": "~2.3|~3.0|~4.0",
21+
"symfony/dom-crawler": "~2.3|~3.0|~4.0"
2222
},
2323

2424
"require-dev": {
2525
"mink/driver-testsuite": "dev-master",
26-
"symfony/http-kernel": "~2.3|~3.0"
26+
"symfony/http-kernel": "~2.3|~3.0|~4.0"
2727
},
2828

2929
"autoload": {

tests/BrowserKitConfig.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,20 @@ protected function supportsJs()
3535
{
3636
return false;
3737
}
38+
39+
public function skipMessage($testCase, $test)
40+
{
41+
if (
42+
'Behat\Mink\Tests\Driver\Form\Html5Test' === $testCase
43+
&& in_array($test, array(
44+
'testHtml5FormAction',
45+
'testHtml5FormMethod',
46+
))
47+
&& !method_exists('Symfony\Component\DomCrawler\Tests\FormTest', 'testGetMethodWithOverride')
48+
) {
49+
return 'Mink BrowserKit doesn\'t support HTML5 form attributes before Symfony 3.3';
50+
}
51+
52+
return parent::skipMessage($testCase, $test);
53+
}
3854
}

tests/Custom/BaseUrlTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
use Behat\Mink\Driver\BrowserKitDriver;
66
use Behat\Mink\Session;
77
use Behat\Mink\Tests\Driver\Util\FixturesKernel;
8+
use PHPUnit\Framework\TestCase;
89
use Symfony\Component\HttpKernel\Client;
910

1011
/**
1112
* @group functional
1213
*/
13-
class BaseUrlTest extends \PHPUnit_Framework_TestCase
14+
class BaseUrlTest extends TestCase
1415
{
1516
public function testBaseUrl()
1617
{

tests/Custom/ErrorHandlingTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
namespace Behat\Mink\Tests\Driver\Custom;
44

55
use Behat\Mink\Driver\BrowserKitDriver;
6+
use PHPUnit\Framework\TestCase;
67
use Symfony\Component\BrowserKit\Client;
78
use Symfony\Component\BrowserKit\Response;
89

9-
class ErrorHandlingTest extends \PHPUnit_Framework_TestCase
10+
class ErrorHandlingTest extends TestCase
1011
{
1112
/**
1213
* @var TestClient

0 commit comments

Comments
 (0)