Skip to content

Test against symfony versions #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ cache:
directories:
- $HOME/.composer/cache/files

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm

env:
global:
- TEST_COMMAND="composer test"
Expand All @@ -27,18 +19,46 @@ branches:
matrix:
fast_finish: true
include:
- php: 7.1
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instanciator:^1.0.5"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also instantiator. Apart from that, any reason why you're locking the version of it? If anything breaks with --prefer-lowest because an older version is installed, it needs to be fixed in that package and should probably be added here as a comment so the workaround can be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is adding the dependency for this one case, so its changing composer.json and thus needs a version constraint.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that, the question is: why do you need it as an explicit dependency?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Slack:

@fbourigault [11:18 AM]
$ composer why doctrine/instantiator
phpspec/phpspec 2.4.0 requires doctrine/instantiator (^1.0.1)
phpspec/prophecy 1.4.0 requires doctrine/instantiator (^1.0.2) (edited)
But it’s for unmaintained versions of those packagesages

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thank you for explaining 👍


# Test the latest stable release
- php: 5.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
env: COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0"

# Test LTS versions
- php: 7.1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Food for thought: test the LTS releases against the lowest common version they and this package supports. I'd say that people on LTS releases are less likely to always run on the latest PHP version, so testing against a lower version might be more comparable to real-world usage.

env: DEPENDENCIES="dunglas/symfony-lock:^2"
- php: 7.1
env: DEPENDENCIES="dunglas/symfony-lock:^3"
- php: 7.1
env: DEPENDENCIES="dunglas/symfony-lock:^4"

# Latest dev release
- php: 7.1
env: STABILITY="dev"

allow_failures:
# Latest dev is allowed to fail.
- env: STABILITY="dev"

before_install:
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;

install:
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction

script:
- composer validate --strict --no-check-lock
- $TEST_COMMAND

after_success:
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
}
],
"require": {
"php": ">=5.4",
"php": "^5.4 || ^7.0",
"php-http/httplug": "^1.1",
"php-http/message-factory": "^1.0",
"php-http/message": "^1.6",
"symfony/options-resolver": "^2.6 || ^3.0 || ^4.0"
},
"require-dev": {
"phpspec/phpspec": "^2.4",
"henrikbjorn/phpspec-code-coverage" : "^1.0",
"phpspec/phpspec": "^2.5 || ^3.4 || ^4.2",
"guzzlehttp/psr7": "^1.4"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/ContentTypePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private function isJson($stream)

json_decode($stream->getContents());

return JSON_ERROR_NONE == json_last_error();
return JSON_ERROR_NONE === json_last_error();
}

/**
Expand Down