From e69f9e001254dc86fe15bcbf025b5816a7451776 Mon Sep 17 00:00:00 2001 From: datagutten Date: Fri, 28 Jun 2019 21:46:17 +0200 Subject: [PATCH 01/10] Do not check exception message --- tests/Transport/Base.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Transport/Base.php b/tests/Transport/Base.php index 566e09fad..ea5a0f972 100644 --- a/tests/Transport/Base.php +++ b/tests/Transport/Base.php @@ -414,10 +414,10 @@ public function testStatusCodeThrow($code, $success) { if (!$success) { if ($code >= 400) { - $this->setExpectedException('Requests_Exception_HTTP_' . $code, '', $code); + $this->setExpectedException('Requests_Exception_HTTP_' . $code, null, $code); } elseif ($code >= 300 && $code < 400) { - $this->setExpectedException('Requests_Exception'); + $this->setExpectedException('Requests_Exception', null); } } $request = Requests::get($url, array(), $options); @@ -439,7 +439,7 @@ public function testStatusCodeThrowAllowRedirects($code, $success) { if (!$success) { if ($code >= 400 || $code === 304 || $code === 305 || $code === 306) { - $this->setExpectedException('Requests_Exception_HTTP_' . $code, '', $code); + $this->setExpectedException('Requests_Exception_HTTP_' . $code, null, $code); } } $request = Requests::get($url, array(), $options); From 6b243e8316b5512b416733fadfa58a8030959e93 Mon Sep 17 00:00:00 2001 From: datagutten Date: Sat, 29 Jun 2019 14:06:34 +0200 Subject: [PATCH 02/10] Fix PHPUnit 6 compatibility --- tests/Transport/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Transport/Base.php b/tests/Transport/Base.php index ea5a0f972..8ca5257b5 100644 --- a/tests/Transport/Base.php +++ b/tests/Transport/Base.php @@ -29,7 +29,7 @@ public function setExpectedException( $exception, $message = '', $code = null ) parent::setExpectedException( $exception, $message, $code ); } else { $this->expectException( $exception ); - if ( '' !== $message ) { + if ( null !== $message ) { $this->expectExceptionMessage( $message ); } if ( null !== $code ) { From b4a8b35fb01ed088f4668a566f58df0083139169 Mon Sep 17 00:00:00 2001 From: datagutten Date: Sat, 29 Jun 2019 14:31:43 +0200 Subject: [PATCH 03/10] Lock PHPUnit version with composer.json #282 --- .travis.yml | 4 ++-- composer.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 106b1fb5f..c318705db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,10 +54,10 @@ before_script: - curl -s -I http://requests-php-tests.herokuapp.com/ > /dev/null # Environment checks - - phpunit --version + - ../vendor/bin/phpunit --version script: - - phpunit --coverage-clover clover.xml + - ../vendor/bin/phpunit --coverage-clover clover.xml after_script: - utils/proxy/stop.sh diff --git a/composer.json b/composer.json index 79744ceeb..653aa0f58 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "php": ">=5.2" }, "require-dev": { - "requests/test-server": "dev-master" + "requests/test-server": "dev-master", + "phpunit/phpunit": "^6.0" }, "type": "library", "autoload": { From 757cd1ec630f781ca0f6f8f53f82d9fbc0496dbe Mon Sep 17 00:00:00 2001 From: datagutten Date: Sat, 29 Jun 2019 14:35:46 +0200 Subject: [PATCH 04/10] PHP 5.6 is only supported by PHPUnit 5.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 653aa0f58..36375943a 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "require-dev": { "requests/test-server": "dev-master", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^5.0" }, "type": "library", "autoload": { From 8edec450906c5ab29ceb4b7bed9e5ad7541a1d72 Mon Sep 17 00:00:00 2001 From: datagutten Date: Sat, 29 Jun 2019 15:13:22 +0200 Subject: [PATCH 05/10] Allow any PHPUnit version below 6.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 36375943a..c2bb58d5e 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "require-dev": { "requests/test-server": "dev-master", - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "<6.0" }, "type": "library", "autoload": { From a605b144e2aaead7c585b9232ed5f1b444fdeb50 Mon Sep 17 00:00:00 2001 From: datagutten Date: Sat, 29 Jun 2019 15:41:38 +0200 Subject: [PATCH 06/10] Use built-in phpunit for PHP 5.* Composer is locked to PHP 5.6, so it will install incompatible versions --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c318705db..877d88c6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,10 @@ before_script: - ../vendor/bin/phpunit --version script: - - ../vendor/bin/phpunit --coverage-clover clover.xml + - if [[ $(phpenv version-name:0:1) == "5" ]]; + then phpunit --coverage-clover clover.xml; + else ../vendor/bin/phpunit --coverage-clover clover.xml; + fi after_script: - utils/proxy/stop.sh From 3a6a2e2709bf11196ca01780e54c1cc969a6c2fe Mon Sep 17 00:00:00 2001 From: datagutten Date: Sat, 29 Jun 2019 17:26:58 +0200 Subject: [PATCH 07/10] New attempt to control PHPUnit version --- .travis.yml | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 877d88c6d..326324b3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,18 +3,26 @@ language: php matrix: fast_finish: true include: - - php: 5.2 - dist: precise - - php: 5.3 - dist: precise - - php: 5.4 - - php: 5.5 - - php: 5.6 - env: TEST_COVERAGE=1 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: nightly + - php: 5.2 + dist: precise + env: COMPOSER_PHPUNIT=false + - php: 5.3 + dist: precise + env: COMPOSER_PHPUNIT=false + - php: 5.4 + env: COMPOSER_PHPUNIT=false + - php: 5.5 + env: COMPOSER_PHPUNIT=false + - php: 5.6 + env: TEST_COVERAGE=1 COMPOSER_PHPUNIT=true + - php: 7.0 + env: COMPOSER_PHPUNIT=true + - php: 7.1 + env: COMPOSER_PHPUNIT=true + - php: 7.2 + env: COMPOSER_PHPUNIT=true + - php: nightly + env: COMPOSER_PHPUNIT=true allow_failures: - php: nightly @@ -30,6 +38,7 @@ cache: install: # Setup the test server - phpenv local $( phpenv versions | grep 5.6 | tail -1 ) + - if [ "$COMPOSER_PHPUNIT" == 'false' ]; then composer remove phpunit/phpunit --dev; fi - composer install --dev --no-interaction - TESTPHPBIN=$(phpenv which php) - phpenv local --unset @@ -54,11 +63,10 @@ before_script: - curl -s -I http://requests-php-tests.herokuapp.com/ > /dev/null # Environment checks - - ../vendor/bin/phpunit --version + - if [ "$COMPOSER_PHPUNIT" == 'false' ]; then phpunit --version; else ../vendor/bin/phpunit --version; fi script: - - if [[ $(phpenv version-name:0:1) == "5" ]]; - then phpunit --coverage-clover clover.xml; + - if [ "$COMPOSER_PHPUNIT" == 'false' ]; then phpunit --coverage-clover clover.xml; else ../vendor/bin/phpunit --coverage-clover clover.xml; fi From fcb184a00d5ec0949406aa3739366ceb590b092b Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Sun, 15 Sep 2019 22:21:54 +0100 Subject: [PATCH 08/10] Update domain name used in tests feelingrestful.com was decommissioned. --- tests/Transport/Base.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Transport/Base.php b/tests/Transport/Base.php index 566e09fad..cd6a99a43 100644 --- a/tests/Transport/Base.php +++ b/tests/Transport/Base.php @@ -587,8 +587,8 @@ public function testAlternateNameSupport() { /** * Test that the transport supports Server Name Indication with HTTPS * - * feelingrestful.com (owned by hmn.md and used with permission) points to - * CloudFlare, and will fail if SNI isn't sent. + * humanmade.com (owned by Human Made and used with permission) points to + * CloudFront, and will fail if SNI isn't sent. */ public function testSNISupport() { if ($this->skip_https) { @@ -596,7 +596,7 @@ public function testSNISupport() { return; } - $request = Requests::head('https://feelingrestful.com/', array(), $this->getOptions()); + $request = Requests::head('https://humanmade.com/', array(), $this->getOptions()); $this->assertEquals(200, $request->status_code); } From eb9cfa39847bbbcc8a65133130dd14dcad731332 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Sun, 15 Sep 2019 22:44:16 +0100 Subject: [PATCH 09/10] Correct definition for allow_failures --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 326324b3b..3260d5292 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,8 @@ matrix: env: COMPOSER_PHPUNIT=true - php: nightly env: COMPOSER_PHPUNIT=true - -allow_failures: - - php: nightly + allow_failures: + - php: nightly # Use new container infrastructure sudo: false From a8d65140597b2c397d2034eea36a6fa907fc5c5b Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Sun, 15 Sep 2019 22:45:01 +0100 Subject: [PATCH 10/10] Add env to allow_failures --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3260d5292..ae64d91e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ matrix: env: COMPOSER_PHPUNIT=true allow_failures: - php: nightly + env: COMPOSER_PHPUNIT=true # Use new container infrastructure sudo: false