Skip to content

Commit

Permalink
Vendorise and use stable version of framework (#2)
Browse files Browse the repository at this point in the history
* Manually set SERVER_PROTOCOL for request tests
* Add php version and minimum stability to composer
  • Loading branch information
Conrad Dobbs authored and robbieaverill committed Nov 14, 2017
1 parent 23623a1 commit ddfb57c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -26,5 +27,7 @@
},
"require-dev": {
"phpunit/phpunit": "^5.7"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
3 changes: 3 additions & 0 deletions tests/HttpRequestAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit ddfb57c

Please sign in to comment.