update-alias-lock2.test 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. --TEST--
  2. Updating an aliased package where the old alias matches the new package should not fail
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. {
  10. "name": "a/a", "version": "1.10.x-dev",
  11. "extra": { "branch-alias": { "dev-master": "1.10.x-dev" } },
  12. "source": { "type": "git", "url": "", "reference": "downgradedref" }
  13. },
  14. {
  15. "name": "a/a", "version": "dev-master",
  16. "extra": { "branch-alias": { "dev-master": "2.x-dev" } },
  17. "source": { "type": "git", "url": "", "reference": "newref" }
  18. }
  19. ]
  20. }
  21. ],
  22. "require": {
  23. "a/a": "^1.0"
  24. },
  25. "minimum-stability": "dev"
  26. }
  27. --LOCK--
  28. {
  29. "_": "outdated lock file, should not have to be loaded in an update",
  30. "packages": [
  31. {
  32. "name": "a/a", "version": "dev-master",
  33. "extra": { "branch-alias": { "dev-master": "1.10.x-dev" } },
  34. "source": { "type": "git", "url": "", "reference": "installedref" }
  35. }
  36. ],
  37. "packages-dev": [],
  38. "aliases": [],
  39. "minimum-stability": "dev",
  40. "stability-flags": [],
  41. "prefer-stable": false,
  42. "prefer-lowest": false
  43. }
  44. --INSTALLED--
  45. [
  46. {
  47. "name": "a/a", "version": "dev-master",
  48. "extra": { "branch-alias": { "dev-master": "1.10.x-dev" } },
  49. "source": { "type": "git", "url": "", "reference": "installedref" }
  50. }
  51. ]
  52. --RUN--
  53. update
  54. --EXPECT-LOCK--
  55. {
  56. "packages": [
  57. {
  58. "name": "a/a", "version": "1.10.x-dev",
  59. "extra": { "branch-alias": { "dev-master": "1.10.x-dev" } },
  60. "source": { "type": "git", "url": "", "reference": "downgradedref" },
  61. "type": "library"
  62. }
  63. ],
  64. "packages-dev": [],
  65. "aliases": [],
  66. "minimum-stability": "dev",
  67. "stability-flags": [],
  68. "prefer-stable": false,
  69. "prefer-lowest": false,
  70. "platform": [],
  71. "platform-dev": []
  72. }
  73. --EXPECT-INSTALLED--
  74. [
  75. {
  76. "name": "a/a", "version": "1.10.x-dev",
  77. "source": { "type": "git", "url": "", "reference": "downgradedref" },
  78. "type": "library",
  79. "extra": { "branch-alias": { "dev-master": "1.10.x-dev" } }
  80. }
  81. ]
  82. --EXPECT--
  83. Marking a/a (1.10.x-dev installedref) as uninstalled, alias of a/a (dev-master installedref)
  84. Downgrading a/a (dev-master installedref => 1.10.x-dev downgradedref)