Commit 5557944d authored by Pascal Luna's avatar Pascal Luna Committed by Fabien Potencier

Test all the 3.x branches in Travis

parent 541d590f
...@@ -9,18 +9,31 @@ env: ...@@ -9,18 +9,31 @@ env:
cache: cache:
directories: directories:
- $HOME/.composer/cache/files - $HOME/.composer/cache/files
- .phpunit
before_install: before_install:
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi
before_script: before_script:
# symfony/* # Twig 1.x
- sh -c "if [ '$TWIG_VERSION' != '2.0' ]; then sed -i 's/~1.8|~2.0/~1.8/g' composer.json; composer update; fi" - if [[ $TWIG_VERSION != 2.0 ]]; then sed -i 's/~1.8|~2.0/~1.8/g' composer.json; fi
- sh -c "if [ '$SYMFONY_DEPS_VERSION' = '3.0' ]; then sed -i 's/~2\.8|^3\.0/3.0.*@dev/g' composer.json; composer update; fi"
- sh -c "if [ '$SYMFONY_DEPS_VERSION' = '3.1' ]; then sed -i 's/~2\.8|^3\.0/3.1.*@dev/g' composer.json; composer update; fi" # Symfony 2.8
- sh -c "if [ '$SYMFONY_DEPS_VERSION' = '3.2' ]; then sed -i 's/~2\.8|^3\.0/3.2.*@dev/g' composer.json; composer update; fi" - if [[ $SYMFONY_DEPS_VERSION = 2.8 ]]; then sed -i 's/~2\.8|^3\.0/2.8.*@dev/g' composer.json; fi
- sh -c "if [ '$SYMFONY_DEPS_VERSION' = '' ]; then sed -i 's/~2\.8|^3\.0/2.8.*@dev/g' composer.json; composer update; fi" # Symfony 3.0
- composer install - if [[ $SYMFONY_DEPS_VERSION = 3.0 ]]; then sed -i 's/~2\.8|^3\.0/3.0.*@dev/g' composer.json; fi
# Symfony 3.1
- if [[ $SYMFONY_DEPS_VERSION = 3.1 ]]; then sed -i 's/~2\.8|^3\.0/3.1.*@dev/g' composer.json; fi
# Symfony 3.2
- if [[ $SYMFONY_DEPS_VERSION = 3.2 ]]; then sed -i 's/~2\.8|^3\.0/3.2.*@dev/g' composer.json; fi
# Symfony 3.3
- |
if [[ $SYMFONY_DEPS_VERSION = 3.3 ]]; then
sed -i 's/~2\.8|^3\.0/3.3.*@dev/g' composer.json;
composer require --dev --no-update symfony/web-link:3.3.*
fi
- composer update --no-suggest
script: ./vendor/bin/simple-phpunit script: ./vendor/bin/simple-phpunit
...@@ -29,16 +42,17 @@ matrix: ...@@ -29,16 +42,17 @@ matrix:
- php: 5.5 - php: 5.5
- php: 5.6 - php: 5.6
env: TWIG_VERSION=2.0 env: TWIG_VERSION=2.0
- php: 5.6
env: SYMFONY_DEPS_VERSION=2.8
- php: 5.6 - php: 5.6
env: SYMFONY_DEPS_VERSION=3.0 env: SYMFONY_DEPS_VERSION=3.0
- php: 5.6 - php: 5.6
env: SYMFONY_DEPS_VERSION=3.1 env: SYMFONY_DEPS_VERSION=3.1
- php: 5.6 - php: 5.6
env: SYMFONY_DEPS_VERSION=3.2 env: SYMFONY_DEPS_VERSION=3.2
- php: 5.6
env: SYMFONY_DEPS_VERSION=3.3
- php: 5.6
- php: 7.0 - php: 7.0
- php: 7.1 - php: 7.1
- php: hhvm - php: hhvm
cache:
directories:
- .phpunit
...@@ -25,6 +25,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse; ...@@ -25,6 +25,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\WebLink\HttpHeaderSerializer;
/** /**
* Application test cases. * Application test cases.
...@@ -660,6 +661,10 @@ class ApplicationTest extends TestCase ...@@ -660,6 +661,10 @@ class ApplicationTest extends TestCase
public function testWebLinkListener() public function testWebLinkListener()
{ {
if (!class_exists(HttpHeaderSerializer::class)) {
self::markTestSkipped('Symfony WebLink component is required.');
}
$app = new Application(); $app = new Application();
$app->get('/', function () { $app->get('/', function () {
......
...@@ -20,6 +20,7 @@ use Silex\Provider\TwigServiceProvider; ...@@ -20,6 +20,7 @@ use Silex\Provider\TwigServiceProvider;
use Silex\Provider\AssetServiceProvider; use Silex\Provider\AssetServiceProvider;
use Symfony\Bridge\Twig\Extension\WebLinkExtension; use Symfony\Bridge\Twig\Extension\WebLinkExtension;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\WebLink\HttpHeaderSerializer;
/** /**
* TwigProvider test cases. * TwigProvider test cases.
...@@ -144,7 +145,7 @@ class TwigServiceProviderTest extends TestCase ...@@ -144,7 +145,7 @@ class TwigServiceProviderTest extends TestCase
public function testWebLinkIntegration() public function testWebLinkIntegration()
{ {
if (!class_exists(WebLinkExtension::class)) { if (!class_exists(HttpHeaderSerializer::class) || !class_exists(WebLinkExtension::class)) {
$this->markTestSkipped('Twig WebLink extension not available.'); $this->markTestSkipped('Twig WebLink extension not available.');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment