update-changes-url.test 6.9 KB

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