update-changes-url.test 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. --TEST--
  2. Update updates URLs for updated packages if they have changed
  3. a/a is dev and gets everything updated as it updates to a new ref
  4. b/b is a tag and gets everything updated by updating the package URL directly
  5. c/c is a tag and not whitelisted and gets the new URL but keeps its old ref
  6. d/d is dev but with a #ref so it should get URL updated but not the reference
  7. e/e is dev and newly installed with a #ref so it should get the correct URL but with the #111 ref
  8. e/e is dev but not whitelisted and gets the new URL but keeps its old ref
  9. --COMPOSER--
  10. {
  11. "repositories": [
  12. {
  13. "type": "package",
  14. "package": [
  15. {
  16. "name": "a/a", "version": "dev-master",
  17. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/a/newa", "type": "git" },
  18. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/a/newa/zipball/2222222222222222222222222222222222222222", "type": "zip" }
  19. },
  20. {
  21. "name": "b/b", "version": "2.0.3",
  22. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/b/newb", "type": "git" },
  23. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/b/newb/zipball/2222222222222222222222222222222222222222", "type": "zip" }
  24. },
  25. {
  26. "name": "c/c", "version": "1.0.0",
  27. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/c/newc", "type": "git" },
  28. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/c/newc/zipball/2222222222222222222222222222222222222222", "type": "zip" }
  29. },
  30. {
  31. "name": "d/d", "version": "dev-master",
  32. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/d/newd", "type": "git" },
  33. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/d/newd/zipball/2222222222222222222222222222222222222222", "type": "zip" }
  34. },
  35. {
  36. "name": "e/e", "version": "dev-master",
  37. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/e/newe", "type": "git" },
  38. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/e/newe/zipball/2222222222222222222222222222222222222222", "type": "zip" }
  39. },
  40. {
  41. "name": "f/f", "version": "dev-master",
  42. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/f/newf", "type": "git" },
  43. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/f/newf/zipball/2222222222222222222222222222222222222222", "type": "zip" }
  44. }
  45. ]
  46. }
  47. ],
  48. "require": {
  49. "a/a": "dev-master",
  50. "b/b": "2.0.3",
  51. "c/c": "1.0.0",
  52. "d/d": "dev-master#1111111111111111111111111111111111111111",
  53. "e/e": "dev-master#1111111111111111111111111111111111111111",
  54. "f/f": "dev-master"
  55. }
  56. }
  57. --INSTALLED--
  58. [
  59. {
  60. "name": "a/a", "version": "dev-master",
  61. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/a/a", "type": "git" },
  62. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/a/a/zipball/1111111111111111111111111111111111111111", "type": "zip" }
  63. },
  64. {
  65. "name": "b/b", "version": "2.0.3",
  66. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/b/b", "type": "git" },
  67. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/b/b/zipball/1111111111111111111111111111111111111111", "type": "zip" }
  68. },
  69. {
  70. "name": "c/c", "version": "1.0.0",
  71. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/c/c", "type": "git" },
  72. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/c/c/zipball/1111111111111111111111111111111111111111", "type": "zip" }
  73. },
  74. {
  75. "name": "d/d", "version": "dev-master",
  76. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/d/d", "type": "git" },
  77. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/d/d/zipball/1111111111111111111111111111111111111111", "type": "zip" }
  78. },
  79. {
  80. "name": "f/f", "version": "dev-master",
  81. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/f/f", "type": "git" },
  82. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/f/f/zipball/1111111111111111111111111111111111111111", "type": "zip" }
  83. }
  84. ]
  85. --EXPECT-LOCK--
  86. {
  87. "packages": [
  88. {
  89. "name": "a/a", "version": "dev-master",
  90. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/a/newa", "type": "git" },
  91. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/a/newa/zipball/2222222222222222222222222222222222222222", "type": "zip", "shasum": null },
  92. "type": "library"
  93. },
  94. {
  95. "name": "b/b", "version": "2.0.3",
  96. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/b/newb", "type": "git" },
  97. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/b/newb/zipball/2222222222222222222222222222222222222222", "type": "zip", "shasum": null },
  98. "type": "library"
  99. },
  100. {
  101. "name": "c/c", "version": "1.0.0",
  102. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/c/newc", "type": "git" },
  103. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/c/newc/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": null },
  104. "type": "library"
  105. },
  106. {
  107. "name": "d/d", "version": "dev-master",
  108. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/d/newd", "type": "git" },
  109. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/d/newd/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": null },
  110. "type": "library"
  111. },
  112. {
  113. "name": "e/e", "version": "dev-master",
  114. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/e/newe", "type": "git" },
  115. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/e/newe/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": null },
  116. "type": "library"
  117. },
  118. {
  119. "name": "f/f", "version": "dev-master",
  120. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/f/newf", "type": "git" },
  121. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/f/newf/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": null },
  122. "type": "library"
  123. }
  124. ],
  125. "packages-dev": [],
  126. "aliases": [],
  127. "minimum-stability": "stable",
  128. "stability-flags": {
  129. "a/a": 20,
  130. "d/d": 20,
  131. "e/e": 20,
  132. "f/f": 20
  133. },
  134. "prefer-stable": false,
  135. "prefer-lowest": false,
  136. "platform": [],
  137. "platform-dev": []
  138. }
  139. --RUN--
  140. update a/a b/b d/d
  141. --EXPECT--
  142. Installing e/e (dev-master 1111111)
  143. Updating a/a (dev-master 1111111) to a/a (dev-master 2222222)