update-allow-list-with-dependencies-alias.test 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --TEST--
  2. Verify that a partial update with deps correctly keeps track of all aliases.
  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/dep", "version": "dev-master", "extra": {"branch-alias": {"dev-master": "1.0.x-dev"}}},
  11. { "name": "current/dep", "version": "1.0.0" },
  12. { "name": "current/dep", "version": "1.1.0", "require": {"current/dep2": "*"} },
  13. { "name": "current/dep", "version": "1.2.0" },
  14. { "name": "current/dep2", "version": "dev-foo", "extra": {"branch-alias": {"dev-foo": "1.0.x-dev"}}},
  15. { "name": "current/dep2", "version": "dev-master", "extra": {"branch-alias": {"dev-master": "2.x-dev"}}},
  16. { "name": "new/pkg", "version": "1.0.0", "require": { "current/dep": "^1.1", "current/dep2": "^1.1"} },
  17. { "name": "new/pkg", "version": "1.1.0", "require": { "current/dep": "^1.2" } }
  18. ]
  19. }
  20. ],
  21. "require": {
  22. "current/dep": "dev-master as 1.1.0",
  23. "current/dep2": "dev-master as 1.1.2",
  24. "current/pkg": "1.0.0 as 2.0.0",
  25. "new/pkg": "1.*"
  26. },
  27. "minimum-stability": "dev"
  28. }
  29. --INSTALLED--
  30. [
  31. { "name": "current/dep", "version": "dev-master", "extra": {"branch-alias": {"dev-master": "1.0.x-dev"}}},
  32. { "name": "current/dep2", "version": "dev-foo", "extra": {"branch-alias": {"dev-foo": "1.0.x-dev"}}},
  33. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } }
  34. ]
  35. --LOCK--
  36. {
  37. "packages": [
  38. { "name": "current/dep", "version": "dev-master", "extra": {"branch-alias": {"dev-master": "1.0.x-dev"}}, "type": "library"},
  39. { "name": "current/dep2", "version": "dev-foo", "extra": {"branch-alias": {"dev-foo": "1.0.x-dev"}}, "type": "library"},
  40. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } }
  41. ],
  42. "packages-dev": [],
  43. "aliases": [
  44. {
  45. "alias": "1.1.0",
  46. "alias_normalized": "1.1.0.0",
  47. "version": "dev-master",
  48. "package": "current/dep"
  49. }
  50. ],
  51. "minimum-stability": "dev",
  52. "stability-flags": [],
  53. "prefer-stable": false,
  54. "prefer-lowest": false,
  55. "platform": [],
  56. "platform-dev": []
  57. }
  58. --RUN--
  59. update new/pkg --with-all-dependencies
  60. --EXPECT-LOCK--
  61. {
  62. "packages": [
  63. { "name": "current/dep", "version": "dev-master", "extra": {"branch-alias": {"dev-master": "1.0.x-dev"}}, "type": "library"},
  64. { "name": "current/dep2", "version": "dev-master", "extra": {"branch-alias": {"dev-master": "2.x-dev"}}, "type": "library"},
  65. { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" }, "type": "library"},
  66. { "name": "new/pkg", "version": "1.0.0", "require": { "current/dep": "^1.1", "current/dep2": "^1.1"}, "type": "library"}
  67. ],
  68. "packages-dev": [],
  69. "aliases": [
  70. {
  71. "alias": "1.1.0",
  72. "alias_normalized": "1.1.0.0",
  73. "version": "dev-master",
  74. "package": "current/dep"
  75. },
  76. {
  77. "alias": "1.1.2",
  78. "alias_normalized": "1.1.2.0",
  79. "version": "dev-master",
  80. "package": "current/dep2"
  81. }
  82. ],
  83. "minimum-stability": "dev",
  84. "stability-flags": {
  85. "current/dep": 20,
  86. "current/dep2": 20
  87. },
  88. "prefer-stable": false,
  89. "prefer-lowest": false,
  90. "platform": [],
  91. "platform-dev": []
  92. }
  93. --EXPECT--
  94. Marking current/dep2 (1.0.x-dev) as uninstalled, alias of current/dep2 (dev-foo)
  95. Marking current/dep (1.1.0) as installed, alias of current/dep (dev-master)
  96. Upgrading current/dep2 (dev-foo => dev-master)
  97. Marking current/dep2 (1.1.2) as installed, alias of current/dep2 (dev-master)
  98. Marking current/dep2 (2.x-dev) as installed, alias of current/dep2 (dev-master)
  99. Installing new/pkg (1.0.0)