update-changes-url.test 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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 remains unchanged
  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. f/f is dev but not whitelisted and remains unchanged
  9. g/g is dev and installed in a different ref than the #ref, so it gets updated and gets the new URL but not the new ref
  10. --COMPOSER--
  11. {
  12. "repositories": [
  13. {
  14. "type": "package",
  15. "package": [
  16. {
  17. "name": "a/a", "version": "dev-master",
  18. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/a/newa", "type": "git" },
  19. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/a/newa/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" }
  20. },
  21. {
  22. "name": "b/b", "version": "2.0.3",
  23. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/b/newb", "type": "git" },
  24. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/b/newb/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" }
  25. },
  26. {
  27. "name": "c/c", "version": "1.0.0",
  28. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/c/newc", "type": "git" },
  29. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/c/newc/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" }
  30. },
  31. {
  32. "name": "d/d", "version": "dev-master",
  33. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/d/newd", "type": "git" },
  34. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/d/newd/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" }
  35. },
  36. {
  37. "name": "e/e", "version": "dev-master",
  38. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/e/newe", "type": "git" },
  39. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/e/newe/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" }
  40. },
  41. {
  42. "name": "f/f", "version": "dev-master",
  43. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/f/newf", "type": "git" },
  44. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/f/newf/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" },
  45. "transport-options": { "foo": "bar2" }
  46. },
  47. {
  48. "name": "g/g", "version": "dev-master",
  49. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/g/newg", "type": "git" },
  50. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/g/newg/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" }
  51. }
  52. ]
  53. }
  54. ],
  55. "require": {
  56. "a/a": "dev-master",
  57. "b/b": "2.0.3",
  58. "c/c": "1.0.0",
  59. "d/d": "dev-master#1111111111111111111111111111111111111111",
  60. "e/e": "dev-master#1111111111111111111111111111111111111111",
  61. "f/f": "dev-master",
  62. "g/g": "dev-master#1111111111111111111111111111111111111111"
  63. }
  64. }
  65. --INSTALLED--
  66. [
  67. {
  68. "name": "a/a", "version": "dev-master",
  69. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/a/a", "type": "git" },
  70. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/a/a/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" }
  71. },
  72. {
  73. "name": "b/b", "version": "2.0.3",
  74. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/b/b", "type": "git" },
  75. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/b/b/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" }
  76. },
  77. {
  78. "name": "c/c", "version": "1.0.0",
  79. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/c/c", "type": "git" },
  80. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/c/c/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" }
  81. },
  82. {
  83. "name": "d/d", "version": "dev-master",
  84. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/d/d", "type": "git" },
  85. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/d/d/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" }
  86. },
  87. {
  88. "name": "f/f", "version": "dev-master",
  89. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/f/f", "type": "git" },
  90. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/f/f/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  91. "transport-options": { "foo": "bar" }
  92. },
  93. {
  94. "name": "g/g", "version": "dev-master",
  95. "source": { "reference": "0000000000000000000000000000000000000000", "url": "https://github.com/g/g", "type": "git" },
  96. "dist": { "reference": "0000000000000000000000000000000000000000", "url": "https://api.github.com/repos/g/g/zipball/0000000000000000000000000000000000000000", "type": "zip", "shasum": "oldsum" },
  97. "transport-options": { "foo": "bar" }
  98. }
  99. ]
  100. --LOCK--
  101. {
  102. "packages": [
  103. {
  104. "name": "a/a", "version": "dev-master",
  105. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/a/a", "type": "git" },
  106. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/a/a/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  107. "type": "library"
  108. },
  109. {
  110. "name": "b/b", "version": "2.0.3",
  111. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/b/b", "type": "git" },
  112. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/b/b/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  113. "type": "library"
  114. },
  115. {
  116. "name": "c/c", "version": "1.0.0",
  117. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/c/c", "type": "git" },
  118. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/c/c/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  119. "type": "library"
  120. },
  121. {
  122. "name": "d/d", "version": "dev-master",
  123. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/d/d", "type": "git" },
  124. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/d/d/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  125. "type": "library"
  126. },
  127. {
  128. "name": "f/f", "version": "dev-master",
  129. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/f/f", "type": "git" },
  130. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/f/f/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  131. "type": "library",
  132. "transport-options": { "foo": "bar" }
  133. },
  134. {
  135. "name": "g/g", "version": "dev-master",
  136. "source": { "reference": "0000000000000000000000000000000000000000", "url": "https://github.com/g/g", "type": "git" },
  137. "dist": { "reference": "0000000000000000000000000000000000000000", "url": "https://api.github.com/repos/g/g/zipball/0000000000000000000000000000000000000000", "type": "zip", "shasum": "oldsum" },
  138. "type": "library",
  139. "transport-options": { "foo": "bar" }
  140. }
  141. ],
  142. "packages-dev": [],
  143. "aliases": [],
  144. "minimum-stability": "stable",
  145. "stability-flags": {},
  146. "prefer-stable": false,
  147. "prefer-lowest": false,
  148. "platform": [],
  149. "platform-dev": []
  150. }
  151. --EXPECT-LOCK--
  152. {
  153. "packages": [
  154. {
  155. "name": "a/a", "version": "dev-master",
  156. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/a/newa", "type": "git" },
  157. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/a/newa/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" },
  158. "type": "library"
  159. },
  160. {
  161. "name": "b/b", "version": "2.0.3",
  162. "source": { "reference": "2222222222222222222222222222222222222222", "url": "https://github.com/b/newb", "type": "git" },
  163. "dist": { "reference": "2222222222222222222222222222222222222222", "url": "https://api.github.com/repos/b/newb/tarball/2222222222222222222222222222222222222222", "type": "tar", "shasum": "newsum" },
  164. "type": "library"
  165. },
  166. {
  167. "name": "c/c", "version": "1.0.0",
  168. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/c/c", "type": "git" },
  169. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/c/c/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  170. "type": "library"
  171. },
  172. {
  173. "name": "d/d", "version": "dev-master",
  174. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/d/newd", "type": "git" },
  175. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/d/newd/tarball/1111111111111111111111111111111111111111", "type": "tar", "shasum": "newsum" },
  176. "type": "library"
  177. },
  178. {
  179. "name": "e/e", "version": "dev-master",
  180. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/e/newe", "type": "git" },
  181. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/e/newe/tarball/1111111111111111111111111111111111111111", "type": "tar", "shasum": "newsum" },
  182. "type": "library"
  183. },
  184. {
  185. "name": "f/f", "version": "dev-master",
  186. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/f/f", "type": "git" },
  187. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/f/f/zipball/1111111111111111111111111111111111111111", "type": "zip", "shasum": "oldsum" },
  188. "type": "library",
  189. "transport-options": { "foo": "bar" }
  190. },
  191. {
  192. "name": "g/g", "version": "dev-master",
  193. "source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/g/newg", "type": "git" },
  194. "dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/g/newg/tarball/1111111111111111111111111111111111111111", "type": "tar", "shasum": "newsum" },
  195. "type": "library"
  196. }
  197. ],
  198. "packages-dev": [],
  199. "aliases": [],
  200. "minimum-stability": "stable",
  201. "stability-flags": {
  202. "a/a": 20,
  203. "d/d": 20,
  204. "e/e": 20,
  205. "f/f": 20,
  206. "g/g": 20
  207. },
  208. "prefer-stable": false,
  209. "prefer-lowest": false,
  210. "platform": [],
  211. "platform-dev": []
  212. }
  213. --RUN--
  214. update a/a b/b d/d g/g
  215. --EXPECT--
  216. Upgrading a/a (dev-master 1111111 => dev-master 2222222)
  217. Upgrading b/b (2.0.3 1111111 => 2.0.3 2222222)
  218. Installing e/e (dev-master 1111111)
  219. Marking e/e (9999999-dev 1111111) as installed, alias of e/e (dev-master 1111111)
  220. Upgrading g/g (dev-master 0000000 => dev-master 1111111)