Skip to content

Commit fcf5989

Browse files
authored
Test against symfony versions (#90)
* Test agains symfony versions * cs fixes * Improve travis tests * Allow failures on BETA * typo * Test LTS releases * typos * Check if string contains slash * Remove Symfony4.0 to see how travis behaves * Make the PR ready for merge * typo * Updated according to feedback * Use tilde * Make sure tests passes * typo * Do not run coverege on min-deps * Introduce stability variable * typo * Fixes * Added back PHPSpec 2 * fixed PHP versions * Fixed deps low * Fixed typo * Minor * Test on rc * PHP 7.1
1 parent 96c43b2 commit fcf5989

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

.travis.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ cache:
88
directories:
99
- $HOME/.composer/cache/files
1010

11-
php:
12-
- 5.4
13-
- 5.5
14-
- 5.6
15-
- 7.0
16-
- 7.1
17-
- hhvm
18-
1911
env:
2012
global:
2113
- TEST_COMMAND="composer test"
@@ -27,18 +19,47 @@ branches:
2719
matrix:
2820
fast_finish: true
2921
include:
22+
- php: 7.1
23+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instantiator:^1.1"
24+
25+
# Test the latest stable release
3026
- php: 5.4
31-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
27+
- php: 5.5
28+
- php: 5.6
29+
- php: 7.0
30+
- php: 7.1
31+
- php: 7.2
32+
env: COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0"
33+
34+
# Test LTS versions
35+
- php: 7.1
36+
env: DEPENDENCIES="dunglas/symfony-lock:^2"
37+
- php: 7.1
38+
env: DEPENDENCIES="dunglas/symfony-lock:^3"
39+
- php: 7.1
40+
env: DEPENDENCIES="dunglas/symfony-lock:^4" STABILITY="rc"
41+
42+
# Latest dev release
43+
- php: 7.1
44+
env: STABILITY="dev"
3245

46+
allow_failures:
47+
# Latest dev is allowed to fail.
48+
- env: STABILITY="dev"
49+
3350
before_install:
3451
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
52+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
53+
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
3554

3655
install:
56+
- cat composer.json
3757
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
38-
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
39-
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
58+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
59+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
4060

4161
script:
62+
- composer validate --strict --no-check-lock
4263
- $TEST_COMMAND
4364

4465
after_success:

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.4",
14+
"php": "^5.4 || ^7.0",
1515
"php-http/httplug": "^1.1",
1616
"php-http/message-factory": "^1.0",
1717
"php-http/message": "^1.6",
1818
"symfony/options-resolver": "^2.6 || ^3.0 || ^4.0"
1919
},
2020
"require-dev": {
21-
"phpspec/phpspec": "^2.4",
22-
"henrikbjorn/phpspec-code-coverage" : "^1.0",
21+
"phpspec/phpspec": "^2.5 || ^3.4 || ^4.2",
2322
"guzzlehttp/psr7": "^1.4"
2423
},
2524
"suggest": {

src/Plugin/ContentTypePlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function isJson($stream)
102102

103103
json_decode($stream->getContents());
104104

105-
return JSON_ERROR_NONE == json_last_error();
105+
return JSON_ERROR_NONE === json_last_error();
106106
}
107107

108108
/**

0 commit comments

Comments
 (0)