update-allow-list-with-dependencies-require-new-replace-mutual.test 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. --TEST--
  2. Require a new package in the composer.json and updating with its name as an argument and with-dependencies should remove packages it replaces which are not root requirements
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "current/pkg", "version": "1.0.0", "require": { "mutual/target": "*", "mutual/target-provide": "*" } },
  10. { "name": "current/dep", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
  11. { "name": "new/pkg", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
  12. { "name": "current/dep-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } },
  13. { "name": "new/pkg-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } }
  14. ]
  15. }
  16. ],
  17. "require": {
  18. "current/pkg": "1.*",
  19. "new/pkg": "1.*",
  20. "new/pkg-provide": "1.*"
  21. }
  22. }
  23. --INSTALLED--
  24. [
  25. { "name": "current/pkg", "version": "1.0.0", "require": { "mutual/target": "*" } },
  26. { "name": "current/dep", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
  27. { "name": "current/dep-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } }
  28. ]
  29. --LOCK--
  30. {
  31. "packages": [
  32. { "name": "current/pkg", "version": "1.0.0", "require": { "mutual/target": "*" } },
  33. { "name": "current/dep", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
  34. { "name": "current/dep-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } }
  35. ],
  36. "packages-dev": [],
  37. "aliases": [],
  38. "minimum-stability": "dev",
  39. "stability-flags": [],
  40. "prefer-stable": false,
  41. "prefer-lowest": false,
  42. "platform": [],
  43. "platform-dev": []
  44. }
  45. --RUN--
  46. update new/pkg --with-dependencies
  47. --EXPECT--
  48. Removing current/dep (1.0.0)
  49. Installing new/pkg (1.0.0)
  50. Installing new/pkg-provide (1.0.0)