update-allow-list-require-new-replace.test 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --TEST--
  2. If a new requirement cannot be installed on a partial update due to replace, there should be a suggestion to use --with-all-dependencies
  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
  42. --EXPECT-EXIT-CODE--
  43. 2
  44. --EXPECT-OUTPUT--
  45. Loading composer repositories with package information
  46. Updating dependencies
  47. Your requirements could not be resolved to an installable set of packages.
  48. Problem 1
  49. - current/dep is locked to version 1.0.0 and an update of this package was not requested.
  50. - new/pkg[1.0.0] cannot be installed as that would require removing current/dep[1.0.0]. new/pkg replaces current/dep and thus cannot coexist with it.
  51. - Root composer.json requires new/pkg 1.* -> satisfiable by new/pkg[1.0.0].
  52. Use the option --with-all-dependencies to allow upgrades, downgrades and removals for packages currently locked to specific versions.
  53. --EXPECT--