update-removes-unused-locked-dep.test 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --TEST--
  2. A composer update should remove unused locked dependencies from the lock file and remove unused installed deps from disk
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "a/a", "version": "1.0.0" },
  10. { "name": "b/b", "version": "1.0.0" }
  11. ]
  12. }
  13. ],
  14. "require": {
  15. "a/a": "*"
  16. }
  17. }
  18. --LOCK--
  19. {
  20. "packages": [
  21. { "name": "a/a", "version": "1.0.0" },
  22. { "name": "b/b", "version": "1.0.0" }
  23. ],
  24. "packages-dev": [],
  25. "aliases": [],
  26. "minimum-stability": "stable",
  27. "stability-flags": [],
  28. "prefer-stable": false,
  29. "prefer-lowest": false,
  30. "platform": [],
  31. "platform-dev": []
  32. }
  33. --INSTALLED--
  34. [
  35. { "name": "a/a", "version": "1.0.0" },
  36. { "name": "b/b", "version": "1.0.0" },
  37. { "name": "c/c", "version": "1.0.0" }
  38. ]
  39. --RUN--
  40. update
  41. --EXPECT-LOCK--
  42. {
  43. "packages": [
  44. { "name": "a/a", "version": "1.0.0", "type": "library" }
  45. ],
  46. "packages-dev": [],
  47. "aliases": [],
  48. "minimum-stability": "stable",
  49. "stability-flags": [],
  50. "prefer-stable": false,
  51. "prefer-lowest": false,
  52. "platform": [],
  53. "platform-dev": []
  54. }
  55. --EXPECT-OUTPUT--
  56. Loading composer repositories with package information
  57. Updating dependencies
  58. Lock file operations: 0 installs, 0 updates, 1 removal
  59. - Removing b/b (1.0.0)
  60. Writing lock file
  61. Installing dependencies from lock file (including require-dev)
  62. Package operations: 0 installs, 0 updates, 2 removals
  63. Generating autoload files
  64. --EXPECT--
  65. Removing c/c (1.0.0)
  66. Removing b/b (1.0.0)