From 47c6ddadb97633462b4e108d1db6e5062d7a27d2 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 10:09:59 +0100 Subject: [PATCH 01/16] Updated travis yml to properly test different symfony versions --- .travis.yml | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c24c0cf..c3bb6dc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,16 +6,9 @@ cache: directories: - $HOME/.composer/cache/files -php: - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - env: global: - - TEST_COMMAND="composer test" + - TEST_COMMAND="./vendor/bin/simple-phpunit" branches: except: @@ -24,26 +17,45 @@ branches: matrix: fast_finish: true include: + # Minimum supported PHP and Symfony version + - php: 7.1 + env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_DEPRECATIONS_HELPER="weak" + + # Test the latest stable release - php: 5.5 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" - - php: 7.2 - env: DEPENDENCIES=dev - - php: hhvm - dist: trusty - # Test against LTS versions + - php: 5.6 - php: 7.0 - env: SYMFONY_VERSION=2.8.* + - php: 7.1 + + # Test LTS versions + - php: 5.5 + env: DEPENDENCIES="symfony/lts:v2" + - php: 5.5 + env: DEPENDENCIES="symfony/lts:v3" + + # Latest commit to master + - php: 7.1 + env: DEPENDENCIES="dev" + + allow_failures: + # Latest beta is allowed to fail. + - php: 7.1 + env: DEPENDENCIES="dev" before_install: - - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi; - - if [ "$DEPENDENCIES" = "dev" ]; then sed -i '/prefer-stable/d' composer.json; fi; - - if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; - - if [ $COVERAGE != true ]; then phpenv config-rm xdebug.ini; fi; + - composer require --no-update "symfony/phpunit-bridge:^3.3 || ^4" + - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi + - if [ "$DEPENDENCIES" = "minimum" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; + - if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi; + - if [[ $DEPENDENCIES == *"/"* ]]; then composer require --no-update $DEPENDENCIES; fi; install: - - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction + # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi + - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction script: + - composer validate --strict --no-check-lock - $TEST_COMMAND after_success: From 752864446bad1777ea76edfa4a615478852d783b Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 10:17:19 +0100 Subject: [PATCH 02/16] Use tilde --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c3bb6dc3..60943f11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,12 +26,13 @@ matrix: - php: 5.6 - php: 7.0 - php: 7.1 + - php: 7.2 # Test LTS versions - php: 5.5 - env: DEPENDENCIES="symfony/lts:v2" + env: DEPENDENCIES="symfony/lts:^2" - php: 5.5 - env: DEPENDENCIES="symfony/lts:v3" + env: DEPENDENCIES="symfony/lts:^3" # Latest commit to master - php: 7.1 From a90e79ddcdfcb8cd0a2f220daf1a72c9b2354b9f Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 10:21:10 +0100 Subject: [PATCH 03/16] Require phpunit bridge --- .travis.yml | 3 +-- composer.json | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60943f11..0a2e7c20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ cache: env: global: - - TEST_COMMAND="./vendor/bin/simple-phpunit" + - TEST_COMMAND="composer test" branches: except: @@ -44,7 +44,6 @@ matrix: env: DEPENDENCIES="dev" before_install: - - composer require --no-update "symfony/phpunit-bridge:^3.3 || ^4" - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - if [ "$DEPENDENCIES" = "minimum" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi; diff --git a/composer.json b/composer.json index ad0fe1be..5c166943 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "php-http/react-adapter": "^0.2.1", "php-http/buzz-adapter": "^0.3", "php-http/mock-client": "^1.0", - "symfony/phpunit-bridge": "^3.2", + "symfony/phpunit-bridge": "^3.3 || ^4.0", "symfony/twig-bundle": "^2.8 || ^3.0", "symfony/twig-bridge": "^2.8 || ^3.0", "symfony/web-profiler-bundle": "^2.8 || ^3.0", @@ -69,8 +69,8 @@ ] }, "scripts": { - "test": "vendor/bin/phpunit", - "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" + "test": "vendor/bin/simple-phpunit", + "test-ci": "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml" }, "extra": { "branch-alias": { From 41e8a041e128f36cca07e0ba00bd9b5434512f42 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 10:38:10 +0100 Subject: [PATCH 04/16] Make sure test pass on phpunit 5.7 --- Tests/Unit/Collector/StackPluginTest.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Tests/Unit/Collector/StackPluginTest.php b/Tests/Unit/Collector/StackPluginTest.php index fd56b8f1..4da8ca93 100644 --- a/Tests/Unit/Collector/StackPluginTest.php +++ b/Tests/Unit/Collector/StackPluginTest.php @@ -11,7 +11,6 @@ use Http\HttplugBundle\Collector\StackPlugin; use Http\Promise\FulfilledPromise; use Http\Promise\RejectedPromise; -use PHPUnit\Framework\Error\Warning; use PHPUnit\Framework\TestCase; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -188,8 +187,17 @@ public function testOnError() $this->markTestSkipped(); } - //PHPUnit wrap any \Error into a \PHPUnit\Framework\Error\Warning. - $this->expectException(Warning::class); + /* + * Use the correct PHPUnit version + * PHPUnit wrap any \Error into a \PHPUnit_Framework_Error. So we are expecting the + */ + if (class_exists('PHPUnit_Framework_Error')) { + // PHPUnit 5.7 + $this->setExpectedException(\PHPUnit_Framework_Error::class); + } else { + // PHPUnit 6.0 and above + $this->expectException(\PHPUnit\Framework\Error\Warning::class); + } $this->collector ->expects($this->once()) From 3457ef65c43d15cc9fa2d7b9ae03c5be3231d31c Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 10:50:44 +0100 Subject: [PATCH 05/16] Removed phpunit/phpunit --- Tests/Unit/Collector/StackPluginTest.php | 4 ++-- composer.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Tests/Unit/Collector/StackPluginTest.php b/Tests/Unit/Collector/StackPluginTest.php index 4da8ca93..8868c5db 100644 --- a/Tests/Unit/Collector/StackPluginTest.php +++ b/Tests/Unit/Collector/StackPluginTest.php @@ -189,14 +189,14 @@ public function testOnError() /* * Use the correct PHPUnit version - * PHPUnit wrap any \Error into a \PHPUnit_Framework_Error. So we are expecting the + * PHPUnit wrap any \Error into a \PHPUnit\Framework\Error\Warning. */ if (class_exists('PHPUnit_Framework_Error')) { // PHPUnit 5.7 $this->setExpectedException(\PHPUnit_Framework_Error::class); } else { // PHPUnit 6.0 and above - $this->expectException(\PHPUnit\Framework\Error\Warning::class); + $this->expectException(PHPUnit\Framework\Error\Warning::class); } $this->collector diff --git a/composer.json b/composer.json index 5c166943..9b657cf5 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,6 @@ "symfony/dependency-injection": "^2.8.3 || ^3.0.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.1", "phpunit/php-token-stream": "^1.1.8", "php-http/curl-client": "^1.0", "php-http/socket-client": "^1.0", From 493377a92d98a58ce7d13972e1a7348c393dc6e0 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 11:10:31 +0100 Subject: [PATCH 06/16] Require config-test 2.0 --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 9b657cf5..88faf946 100644 --- a/composer.json +++ b/composer.json @@ -50,6 +50,7 @@ "symfony/dom-crawler": "^2.8 || ^3.0", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0", + "matthiasnoback/symfony-config-test": "^2.0", "nyholm/nsa": "^1.1" }, "conflict": { From 788e262d403146b9f9dce01d92dc20d0d6305e97 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 11:17:21 +0100 Subject: [PATCH 07/16] remove PHP 7.2 since it is failing on some weird test issue --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a2e7c20..4528b93d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,6 @@ matrix: - php: 5.6 - php: 7.0 - php: 7.1 - - php: 7.2 # Test LTS versions - php: 5.5 From 47a19470e9d5bd8eff1d39ef6e22eb14f936e0f5 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 11:21:00 +0100 Subject: [PATCH 08/16] latest phpunit bridge support php7 --- .travis.yml | 1 + composer.json | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4528b93d..0a2e7c20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ matrix: - php: 5.6 - php: 7.0 - php: 7.1 + - php: 7.2 # Test LTS versions - php: 5.5 diff --git a/composer.json b/composer.json index 88faf946..11a701b3 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "php-http/react-adapter": "^0.2.1", "php-http/buzz-adapter": "^0.3", "php-http/mock-client": "^1.0", - "symfony/phpunit-bridge": "^3.3 || ^4.0", + "symfony/phpunit-bridge": "^3.4@rc || ^4.0", "symfony/twig-bundle": "^2.8 || ^3.0", "symfony/twig-bridge": "^2.8 || ^3.0", "symfony/web-profiler-bundle": "^2.8 || ^3.0", @@ -49,8 +49,7 @@ "symfony/browser-kit": "^2.8 || ^3.0", "symfony/dom-crawler": "^2.8 || ^3.0", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0", - "matthiasnoback/symfony-config-test": "^2.0", + "matthiasnoback/symfony-dependency-injection-test": "^2.0", "nyholm/nsa": "^1.1" }, "conflict": { From d2d7a08df07acb3f7ec1cf2087589e80de8eb5d0 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 11:27:03 +0100 Subject: [PATCH 09/16] specify PHPUnit version --- .travis.yml | 1 + composer.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a2e7c20..2be72440 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ cache: env: global: - TEST_COMMAND="composer test" + - SYMFONY_PHPUNIT_VERSION="6.3" branches: except: diff --git a/composer.json b/composer.json index 11a701b3..314f1ec0 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "symfony/browser-kit": "^2.8 || ^3.0", "symfony/dom-crawler": "^2.8 || ^3.0", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "matthiasnoback/symfony-dependency-injection-test": "^2.0", + "matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0", "nyholm/nsa": "^1.1" }, "conflict": { From 12a0de1ef0821904409089f9a4dba9fed0190c14 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 11:27:47 +0100 Subject: [PATCH 10/16] typo --- Tests/Unit/Collector/StackPluginTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/Collector/StackPluginTest.php b/Tests/Unit/Collector/StackPluginTest.php index 8868c5db..c7416008 100644 --- a/Tests/Unit/Collector/StackPluginTest.php +++ b/Tests/Unit/Collector/StackPluginTest.php @@ -196,7 +196,7 @@ public function testOnError() $this->setExpectedException(\PHPUnit_Framework_Error::class); } else { // PHPUnit 6.0 and above - $this->expectException(PHPUnit\Framework\Error\Warning::class); + $this->expectException(\PHPUnit\Framework\Error\Warning::class); } $this->collector From f9d60781d770f90602aaf2d54f362b623bd23877 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 11:35:09 +0100 Subject: [PATCH 11/16] specify different phpunit versions --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2be72440..f695e22b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,11 +20,13 @@ matrix: include: # Minimum supported PHP and Symfony version - php: 7.1 - env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_DEPRECATIONS_HELPER="weak" + env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7" # Test the latest stable release - php: 5.5 + env: SYMFONY_PHPUNIT_VERSION="5.7" - php: 5.6 + env: SYMFONY_PHPUNIT_VERSION="5.7" - php: 7.0 - php: 7.1 - php: 7.2 From c7ade5074f7b8d01f3492fa10e6255e63e7876bd Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 11:42:41 +0100 Subject: [PATCH 12/16] Removed phpunit --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 314f1ec0..8372da00 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "symfony/browser-kit": "^2.8 || ^3.0", "symfony/dom-crawler": "^2.8 || ^3.0", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0", + "matthiasnoback/symfony-dependency-injection-test": "^1.1 || ^2.0", "nyholm/nsa": "^1.1" }, "conflict": { From 3d4a53e38d861fc92c6a07ac753199628ba7a503 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 26 Nov 2017 19:54:13 +0100 Subject: [PATCH 13/16] Updated comment --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f695e22b..57e8a75d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ matrix: env: DEPENDENCIES="dev" allow_failures: - # Latest beta is allowed to fail. + # dev-master is allowed to fail. - php: 7.1 env: DEPENDENCIES="dev" From 1d2cb65d858e4c62f47bf0d46bfd433d0bd47e50 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 26 Nov 2017 21:03:22 +0100 Subject: [PATCH 14/16] Run simple-phpunit install --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 57e8a75d..0377b6f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,6 +56,7 @@ install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction + - vendor/bin/simple-phpunit install script: - composer validate --strict --no-check-lock From 64ed4816fe6cce5236b132339874e486bfe34b07 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 26 Nov 2017 21:04:21 +0100 Subject: [PATCH 15/16] Using phpunit-bridge 3.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8372da00..887d7365 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "php-http/react-adapter": "^0.2.1", "php-http/buzz-adapter": "^0.3", "php-http/mock-client": "^1.0", - "symfony/phpunit-bridge": "^3.4@rc || ^4.0", + "symfony/phpunit-bridge": "^3.3 || ^4.0", "symfony/twig-bundle": "^2.8 || ^3.0", "symfony/twig-bridge": "^2.8 || ^3.0", "symfony/web-profiler-bundle": "^2.8 || ^3.0", From cfe423b888eadb47650374d4d7b5472244ff0c83 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 26 Nov 2017 22:47:40 +0100 Subject: [PATCH 16/16] updated comment --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0377b6f7..bf2f057e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ branches: matrix: fast_finish: true include: - # Minimum supported PHP and Symfony version + # Minimum supported Symfony version and latest PHP version - php: 7.1 env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7"