Skip to content

adds phpunit as dev dependency #183

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 2 commits into from
Jan 20, 2020
Merged

adds phpunit as dev dependency #183

merged 2 commits into from
Jan 20, 2020

Conversation

Headd2k
Copy link
Contributor

@Headd2k Headd2k commented Jan 19, 2020

this pr adds missing phpunit dev dependencies, fixes existing tests and sets base php platform in composer to ensure only compatible dependencies

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets fix #182
Documentation -
License MIT

What's in this PR?

  • adds required dev dependencies to composer.json to run existing phpunit tests
  • fixes existing phpunit tests
  • adds phpunit execution to composer test scripts
  • adds base platform to composer.json to ensure only php 7.1 compatible dependencies getting added

Why?

Existing PHPUnit tests should get executed during CI runs.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix (@dbu thinks: not needed for a testing setup change)

To Do

  • Need feedback if we could/should replace nyholm/psr7 dependencies/usage in tests with something else
  • Need feedback if setting the base platform in composer.json to ensure php 7.1 compatible dependencies only is okay

…latform in composer to ensure only compatible dependencies
Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

oh, i was not aware that we also have phpunit tests in here... thanks for spotting and cleaning it all up.

i only have one small question what the platform => php config option is for?

@dbu
Copy link
Contributor

dbu commented Jan 20, 2020

sorry, reading the questions now:

  • i would leave the platform thingy out. on travis-ci we do run with all minor php versions we support, that should cover this.
  • nyholm/psr7 seems fine to me

@Headd2k
Copy link
Contributor Author

Headd2k commented Jan 20, 2020

thanks for your quick reply! i updated the pr to remove the base php platform setting. the initial purpose was to have a "safer" process for adding new dependencies. i currently have php 7.2 on my local machine. when i check out the library and run "composer require --dev phpunit/phpunit" i get phpunit 8.x installed because this version is compatible with php 7.2. but the library must support php 7.1. so with the "platform" setting in the composer configuration the require command would have installed phpunit 7.x as this was the last phpunit version branch supporting php 7.1.

@dbu
Copy link
Contributor

dbu commented Jan 20, 2020

thanks for the explanation. i don't think we need to worry about adding dependencies: travis-ci will catch it if it goes wrong, and its not often that we add new dependencies. (a library is much more stable than an application usually)

@dbu dbu merged commit 03086a2 into php-http:master Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHPUnit is missing as dev-dependency and in CI
3 participants