From 40cb85663481e371ed08e0eea08fdff4735306a4 Mon Sep 17 00:00:00 2001 From: BgdB Date: Sat, 18 Nov 2017 14:31:20 +0200 Subject: [PATCH] Added support for Symfony 4. --- .travis.yml | 15 +++++++++++++-- Resources/config/services.xml | 6 +++--- Tests/Aop/InterceptorLoaderTest.php | 7 ++++--- composer.json | 5 +++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b6cf8e..865d17f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,11 @@ language: php php: - - 5.3 - 5.4 - 5.5 - 5.6 + - 7.0 + - 7.1 sudo: false @@ -16,16 +17,26 @@ matrix: fast_finish: true include: - php: 5.3 + dist: precise env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak + # test 2.7 LTS - php: 5.6 env: SYMFONY_VERSION='2.7.*' + # test 2.8 LTS - php: 5.6 env: SYMFONY_VERSION='2.8.*' + # test the latest stable 3.x release + - php: 5.6 + env: SYMFONY_VERSION=^3.0 + # test the latest release (including beta releases) + - php: 7.1 + env: DEPENDENCIES=beta before_install: + - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - composer self-update - if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi install: composer update $COMPOSER_FLAGS -script: phpunit +script: ./vendor/bin/phpunit diff --git a/Resources/config/services.xml b/Resources/config/services.xml index c1caed4..86c6869 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -9,9 +9,9 @@ - - - + + + diff --git a/Tests/Aop/InterceptorLoaderTest.php b/Tests/Aop/InterceptorLoaderTest.php index 70c2ec6..2191267 100644 --- a/Tests/Aop/InterceptorLoaderTest.php +++ b/Tests/Aop/InterceptorLoaderTest.php @@ -19,12 +19,13 @@ namespace JMS\AopBundle\Tests\Aop; use JMS\AopBundle\Aop\InterceptorLoader; +use PHPUnit\Framework\TestCase; -class InterceptorLoaderTest extends \PHPUnit_Framework_TestCase +class InterceptorLoaderTest extends TestCase { public function testLoadInterceptors() { - $interceptor = $this->getMock('CG\Proxy\MethodInterceptorInterface'); + $interceptor = $this->getMockBuilder('CG\Proxy\MethodInterceptorInterface')->getMock(); list($loader, $container) = $this->getLoader(array( 'JMS\AopBundle\Tests\Aop\InterceptorLoaderTestClass' => array( @@ -48,7 +49,7 @@ public function testLoadInterceptors() private function getLoader(array $interceptors = array()) { - $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock(); return array(new InterceptorLoader($container, $interceptors), $container); } diff --git a/composer.json b/composer.json index d49ae3c..73d4453 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,12 @@ ], "require": { "php": ">=5.3.9", - "symfony/framework-bundle": "^2.3|^3.0", + "symfony/framework-bundle": "^2.3 || ^3.0 || ^4.0", "jms/cg": "^1.1" }, "require-dev": { - "symfony/phpunit-bridge": "^2.7" + "symfony/phpunit-bridge": "^2.7 || ^4.0", + "phpunit/phpunit": "^4.8.36 | ^5.0" }, "autoload": { "psr-4": { "JMS\\AopBundle\\": "" }