diff --git a/.travis.yml b/.travis.yml index 106b1fb5f..ae64d91e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,21 +3,29 @@ 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: 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 - -allow_failures: - - php: nightly + env: COMPOSER_PHPUNIT=true # Use new container infrastructure sudo: false @@ -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,10 +63,12 @@ before_script: - curl -s -I http://requests-php-tests.herokuapp.com/ > /dev/null # Environment checks - - phpunit --version + - if [ "$COMPOSER_PHPUNIT" == 'false' ]; then phpunit --version; else ../vendor/bin/phpunit --version; fi script: - - phpunit --coverage-clover clover.xml + - if [ "$COMPOSER_PHPUNIT" == 'false' ]; then phpunit --coverage-clover clover.xml; + else ../vendor/bin/phpunit --coverage-clover clover.xml; + fi after_script: - utils/proxy/stop.sh diff --git a/composer.json b/composer.json index 79744ceeb..c2bb58d5e 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": { diff --git a/tests/Transport/Base.php b/tests/Transport/Base.php index 566e09fad..b9e019667 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 ) { @@ -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); @@ -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); }