]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Upgrade PHPUnit to version 5
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sun, 24 Jul 2016 09:15:51 +0000 (11:15 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 22 Aug 2016 18:16:50 +0000 (20:16 +0200)
- Fix deprecated getMock
- Use PHPUnit 4 for PHP 5.5 build

Manually cherry-picked from PR
https://github.com/wallabag/wallabag/pull/2201

.travis.yml
composer.json
tests/Wallabag/CoreBundle/EventListener/LocaleListenerTest.php

index dd8815c13cd2808f579e3149db9532c66cb67119..69b4f91984928960a3cae24ed311ddd6351880c1 100644 (file)
@@ -55,6 +55,7 @@ branches:
 before_script:
     - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
     - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
+    - if [ "$TRAVIS_PHP_VERSION" = "5.5" ]; then composer require "phpunit/phpunit:4.*" --no-update; fi;
     - composer self-update --no-progress
     - if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
 
index 38ccec81b042d77679456bda3073a2e34044a48f..bdaad60146c186979ec5185ead19257df341825d 100644 (file)
@@ -87,7 +87,7 @@
         "doctrine/doctrine-fixtures-bundle": "~2.2",
         "doctrine/data-fixtures": "~1.1.1",
         "sensio/generator-bundle": "^3.0",
-        "phpunit/phpunit": "~4.4",
+        "phpunit/phpunit": "~5.0",
         "symfony/phpunit-bridge": "^3.0",
         "friendsofphp/php-cs-fixer": "~1.9"
     },
index 2a7f939067fb0a8ca7e0b84f8829c921a47c47e4..078bb69aed905d75847a87525785a649cfa724aa 100644 (file)
@@ -15,7 +15,11 @@ class LocaleListenerTest extends \PHPUnit_Framework_TestCase
 {
     private function getEvent(Request $request)
     {
-        return new GetResponseEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, HttpKernelInterface::MASTER_REQUEST);
+        $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        return new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
     }
 
     public function testWithoutSession()