update-allow-list-patterns-with-root-dependencies.test 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. --TEST--
  2. Update with a package whitelist only updates those packages and their dependencies matching the pattern
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "fixed/pkg", "version": "1.1.0" },
  10. { "name": "fixed/pkg", "version": "1.0.0" },
  11. { "name": "whitelisted/pkg-component1", "version": "1.1.0", "require": { "whitelisted/pkg-component2": "1.1.0" } },
  12. { "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } },
  13. { "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0", "whitelisted/pkg-component5": "1.0.0" } },
  14. { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
  15. { "name": "whitelisted/pkg-component3", "version": "1.1.0", "require": { "whitelisted/pkg-component4": "1.1.0" } },
  16. { "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } },
  17. { "name": "whitelisted/pkg-component4", "version": "1.1.0" },
  18. { "name": "whitelisted/pkg-component4", "version": "1.0.0" },
  19. { "name": "whitelisted/pkg-component5", "version": "1.1.0" },
  20. { "name": "whitelisted/pkg-component5", "version": "1.0.0" },
  21. { "name": "dependency/pkg", "version": "1.1.0" },
  22. { "name": "dependency/pkg", "version": "1.0.0" },
  23. { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } },
  24. { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
  25. { "name": "unrelated/pkg-dependency", "version": "1.1.0" },
  26. { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
  27. ]
  28. }
  29. ],
  30. "require": {
  31. "fixed/pkg": "1.*",
  32. "whitelisted/pkg-component1": "1.*",
  33. "whitelisted/pkg-component2": "1.*",
  34. "whitelisted/pkg-component3": "1.0.0",
  35. "unrelated/pkg": "1.*"
  36. }
  37. }
  38. --INSTALLED--
  39. [
  40. { "name": "fixed/pkg", "version": "1.0.0" },
  41. { "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } },
  42. { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
  43. { "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } },
  44. { "name": "whitelisted/pkg-component4", "version": "1.0.0" },
  45. { "name": "whitelisted/pkg-component5", "version": "1.0.0" },
  46. { "name": "dependency/pkg", "version": "1.0.0" },
  47. { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
  48. { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
  49. ]
  50. --LOCK--
  51. {
  52. "packages": [
  53. { "name": "fixed/pkg", "version": "1.0.0" },
  54. { "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } },
  55. { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
  56. { "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } },
  57. { "name": "whitelisted/pkg-component4", "version": "1.0.0" },
  58. { "name": "whitelisted/pkg-component5", "version": "1.0.0" },
  59. { "name": "dependency/pkg", "version": "1.0.0" },
  60. { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
  61. { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
  62. ],
  63. "packages-dev": [],
  64. "aliases": [],
  65. "minimum-stability": "dev",
  66. "stability-flags": [],
  67. "prefer-stable": false,
  68. "prefer-lowest": false,
  69. "platform": [],
  70. "platform-dev": []
  71. }
  72. --RUN--
  73. update whitelisted/pkg-* foobar --with-dependencies
  74. --EXPECT--
  75. Upgrading dependency/pkg (1.0.0 => 1.1.0)
  76. Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0)
  77. Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0)