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

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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": { "current/dep": "*" } },
  10. { "name": "current/dep", "version": "1.0.0" },
  11. { "name": "new/pkg", "version": "1.0.0", "replace": { "current/dep": "1.0.0" } }
  12. ]
  13. }
  14. ],
  15. "require": {
  16. "current/pkg": "1.*",
  17. "new/pkg": "1.*"
  18. }
  19. }
  20. --INSTALLED--
  21. [
  22. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "*" } },
  23. { "name": "current/dep", "version": "1.0.0" }
  24. ]
  25. --LOCK--
  26. {
  27. "packages": [
  28. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "*" } },
  29. { "name": "current/dep", "version": "1.0.0" }
  30. ],
  31. "packages-dev": [],
  32. "aliases": [],
  33. "minimum-stability": "dev",
  34. "stability-flags": [],
  35. "prefer-stable": false,
  36. "prefer-lowest": false,
  37. "platform": [],
  38. "platform-dev": []
  39. }
  40. --RUN--
  41. update new/pkg --with-dependencies
  42. --EXPECT--
  43. Removing current/dep (1.0.0)
  44. Installing new/pkg (1.0.0)