update-allow-list-with-dependencies-require-new.test 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. Require a new package in the composer.json and updating with its name as an argument and with-dependencies should update locked dependencies as far as possible
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } },
  10. { "name": "current/pkg", "version": "1.1.0", "require": { "current/dep": "^1.0" } },
  11. { "name": "current/dep", "version": "1.0.0" },
  12. { "name": "current/dep", "version": "1.1.0" },
  13. { "name": "current/dep", "version": "1.2.0" },
  14. { "name": "new/pkg", "version": "1.0.0", "require": { "current/dep": "^1.1" } },
  15. { "name": "new/pkg", "version": "1.1.0", "require": { "current/dep": "^1.2" } }
  16. ]
  17. }
  18. ],
  19. "require": {
  20. "current/pkg": "1.*",
  21. "new/pkg": "1.*"
  22. }
  23. }
  24. --INSTALLED--
  25. [
  26. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } },
  27. { "name": "current/dep", "version": "1.0.0" }
  28. ]
  29. --LOCK--
  30. {
  31. "packages": [
  32. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } },
  33. { "name": "current/dep", "version": "1.0.0" }
  34. ],
  35. "packages-dev": [],
  36. "aliases": [],
  37. "minimum-stability": "dev",
  38. "stability-flags": [],
  39. "prefer-stable": false,
  40. "prefer-lowest": false,
  41. "platform": [],
  42. "platform-dev": []
  43. }
  44. --RUN--
  45. update new/pkg --with-dependencies
  46. --EXPECT--
  47. Upgrading current/dep (1.0.0 => 1.1.0)
  48. Installing new/pkg (1.0.0)