repositories-priorities.test 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Packages found in a higher priority repository take precedence even if they are not found in the requested version
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "foo/a", "version": "1.0.0" }
  10. ]
  11. },
  12. {
  13. "type": "package",
  14. "package": [
  15. { "name": "foo/a", "version": "2.0.0" }
  16. ]
  17. }
  18. ],
  19. "require": {
  20. "foo/a": "2.*"
  21. }
  22. }
  23. --RUN--
  24. update
  25. --EXPECT-OUTPUT--
  26. Loading composer repositories with package information
  27. Updating dependencies
  28. Your requirements could not be resolved to an installable set of packages.
  29. Problem 1
  30. - Root composer.json requires foo/a 2.*, it is satisfiable by foo/a[2.0.0] from package repo (defining 1 package) but foo/a[1.0.0] from package repo (defining 1 package) has higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.
  31. --EXPECT--
  32. --EXPECT-EXIT-CODE--
  33. 2