diff --git a/.travis.yml b/.travis.yml index 6bf0e22..588eb91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,13 +9,13 @@ env: before_script: - phpenv rehash + - echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - composer self-update - - git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support - - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss - - cd ~/builds/ss + - composer validate + - composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile script: - - vendor/bin/phpunit --coverage-clover=coverage.xml psr7-adapters/tests + - vendor/bin/phpunit --coverage-clover=coverage.xml ./tests after_success: - mv coverage.xml ~/build/$TRAVIS_REPO_SLUG diff --git a/composer.json b/composer.json index eb12969..2e793eb 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,10 @@ { "name": "robbie/psr7-adapters", "description": "PSR-7 compliant adapters for SilverStripe HTTP classes", - "type": "silverstripe-module", + "type": "silverstripe-vendormodule", "require": { - "silverstripe/framework": "^4.0@dev", + "php": ">=5.6.0", + "silverstripe/framework": "^4.0", "guzzlehttp/psr7": "^1.3" }, "license": "BSD-3-Clause", @@ -26,5 +27,7 @@ }, "require-dev": { "phpunit/phpunit": "^5.7" - } + }, + "minimum-stability": "dev", + "prefer-stable": true } diff --git a/tests/HttpRequestAdapterTest.php b/tests/HttpRequestAdapterTest.php index 6a5f879..10760d9 100644 --- a/tests/HttpRequestAdapterTest.php +++ b/tests/HttpRequestAdapterTest.php @@ -79,6 +79,9 @@ public function testGetHttpRequestFromPsr7Interface() */ protected function getInterface($method, $uri, $get = [], $post = [], $body = null) { + // set server protocol as AbstractHttpAdapter relies on it + $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; + $httpRequest = new HTTPRequest($method, $uri, $get, $post, $body); $adapter = new HttpRequestAdapter; $adapter->setServerVars($this->mockRequestData());