replace-priorities.test 931 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", "version": "1.1.0", "replace": { "package2": "1.1.0" } }
  10. ]
  11. },
  12. {
  13. "type": "package",
  14. "package": [
  15. { "name": "package", "version": "1.0.0" },
  16. { "name": "package2", "version": "1.0.0" },
  17. { "name": "package3", "version": "1.0.0", "require": { "forked": "*" } },
  18. { "name": "hijacker", "version": "1.1.0", "replace": { "package": "1.1.0" } }
  19. ]
  20. }
  21. ],
  22. "require": {
  23. "package": "1.*",
  24. "package2": "1.*",
  25. "package3": "1.*"
  26. }
  27. }
  28. --RUN--
  29. install
  30. --EXPECT--
  31. Installing package (1.0.0)
  32. Installing forked (1.1.0)
  33. Installing package3 (1.0.0)