alias-in-lock.test 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. --TEST--
  2. Root-defined aliases end up in lock file only if required to solve deps
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. {
  10. "name": "a/aliased", "version": "3.0.2"
  11. },
  12. {
  13. "name": "a/aliased2", "version": "3.0.2"
  14. },
  15. {
  16. "name": "b/requirer", "version": "1.0.0",
  17. "require": { "a/aliased": "^3.0.3", "a/aliased2": "^3.0.0" }
  18. }
  19. ]
  20. }
  21. ],
  22. "require": {
  23. "a/aliased": "3.0.2 as 3.0.3",
  24. "a/aliased2": "3.0.2 as 3.0.3",
  25. "b/requirer": "*"
  26. }
  27. }
  28. --RUN--
  29. update
  30. --EXPECT-LOCK--
  31. {
  32. "packages": [
  33. {
  34. "name": "a/aliased", "version": "3.0.2",
  35. "type": "library"
  36. },
  37. {
  38. "name": "a/aliased2", "version": "3.0.2",
  39. "type": "library"
  40. },
  41. {
  42. "name": "b/requirer", "version": "1.0.0",
  43. "require": { "a/aliased": "^3.0.3", "a/aliased2": "^3.0.0" },
  44. "type": "library"
  45. }
  46. ],
  47. "packages-dev": [],
  48. "aliases": [{
  49. "package": "a/aliased",
  50. "version": "3.0.2.0",
  51. "alias": "3.0.3",
  52. "alias_normalized": "3.0.3.0"
  53. }],
  54. "minimum-stability": "stable",
  55. "stability-flags": [],
  56. "prefer-stable": false,
  57. "prefer-lowest": false,
  58. "platform": [],
  59. "platform-dev": []
  60. }
  61. --EXPECT--
  62. Installing a/aliased2 (3.0.2)
  63. Installing a/aliased (3.0.2)
  64. Marking a/aliased (3.0.3) as installed, alias of a/aliased (3.0.2)
  65. Installing b/requirer (1.0.0)