Skip to content
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

Faulty dependency constraint affecting getObjectForTrait (failure using --prefer-lowest) #3094

Closed
Bilge opened this issue Apr 13, 2018 · 2 comments

Comments

@Bilge
Copy link
Contributor

Bilge commented Apr 13, 2018

Q A
PHPUnit version 7.1.2
PHP version 7.1.6
Installation Method Composer

A call to getObjectForTrait() works on PHPUnit 7.1.2, but fails when installing the same version with composer up --prefer-lowest. Following is the list of changed packages when prefer lowest is enabled.

$ composer up --prefer-lowest
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 10 updates, 3 removals
  - Removing webmozart/assert (1.3.0)
  - Removing phpdocumentor/type-resolver (0.4.0)
  - Removing phpdocumentor/reflection-common (1.0.1)
  - Updating scriptfusion/retry (1.1.1 => 1.1.0): Loading from cache
  - Updating amphp/amp (v2.0.6 => v2.0.0): Loading from cache
  - Updating psr/cache (1.0.1 => 1.0.0): Loading from cache
  - Updating myclabs/deep-copy (1.7.0 => 1.6.1): Loading from cache
  - Updating doctrine/instantiator (1.1.0 => 1.0.5): Loading from cache
  - Installing dflydev/markdown (v1.0.0): Loading from cache
  - Updating phpdocumentor/reflection-docblock (4.3.0 => 2.0.0): Loading from cache
  - Updating phpspec/prophecy (1.7.5 => v1.7.0): Loading from cache
  - Updating phpunit/php-file-iterator (1.4.5 => 1.4.3): Loading from cache
  - Updating phpunit/php-code-coverage (6.0.3 => 6.0.1): Loading from cache
  - Updating phpunit/phpunit-mock-objects (6.1.1 => 6.1.0): Loading from cache
Package dflydev/markdown is abandoned, you should avoid using it. Use michelf/php-markdown instead.
Writing lock file
Generating autoload files

Overriding phpunit/phpunit-mock-objects with version ^6.1.1 fixes the issue.

@sebastianbergmann
Copy link
Owner

I understand what --prefer-lowest does but I do not understand why people use it, makes no sense to me. Why would you not want the latest version of a component that is compatible with the version of the component that is required?

Anyways, I merged your pull request.

@Bilge
Copy link
Contributor Author

Bilge commented Apr 13, 2018

@sebastianbergmann Since you understand --prefer-lowest you should understand why I'm using it because my reasons are the same as yours. I do not use it for development, only for my Composer constraint testing. However, there is no way I know of to only test my own constraints are correct: it also requires all dependencies to be using the correct constraints also. That is why I recommended you take a look at your test coverage for getObjectForTrait(), because it seems you must have a blind spot there.

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

No branches or pull requests

2 participants