replace-priorities.test 961 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Replace takes precedence only in higher priority repositories and if explicitly required
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "forked/pkg", "version": "1.1.0", "replace": { "package/2": "1.1.0" } }
  10. ]
  11. },
  12. {
  13. "type": "package",
  14. "package": [
  15. { "name": "package/1", "version": "1.0.0" },
  16. { "name": "package/2", "version": "1.0.0" },
  17. { "name": "package/3", "version": "1.0.0", "require": { "forked/pkg": "*" } },
  18. { "name": "hijacker/pkg", "version": "1.1.0", "replace": { "package/1": "1.1.0" } }
  19. ]
  20. }
  21. ],
  22. "require": {
  23. "package/1": "1.*",
  24. "package/2": "1.*",
  25. "package/3": "1.*"
  26. }
  27. }
  28. --RUN--
  29. install
  30. --EXPECT--
  31. Installing package/1 (1.0.0)
  32. Installing forked/pkg (1.1.0)
  33. Installing package/3 (1.0.0)