update-allow-list-removes-unused.test 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. Update with a package whitelist removes unused packages
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. { "name": "whitelisted/pkg", "version": "1.1.0" },
  10. { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "fixed/dependency": "1.0.0", "old/dependency": "1.0.0" } },
  11. { "name": "fixed/dependency", "version": "1.1.0" },
  12. { "name": "fixed/dependency", "version": "1.0.0" },
  13. { "name": "old/dependency", "version": "1.0.0" }
  14. ]
  15. }
  16. ],
  17. "require": {
  18. "whitelisted/pkg": "1.*",
  19. "fixed/dependency": "1.*"
  20. }
  21. }
  22. --INSTALLED--
  23. [
  24. { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } },
  25. { "name": "fixed/dependency", "version": "1.0.0" },
  26. { "name": "old/dependency", "version": "1.0.0" }
  27. ]
  28. --LOCK--
  29. {
  30. "packages": [
  31. { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } },
  32. { "name": "fixed/dependency", "version": "1.0.0" },
  33. { "name": "old/dependency", "version": "1.0.0" }
  34. ],
  35. "packages-dev": [],
  36. "aliases": [],
  37. "minimum-stability": "dev",
  38. "stability-flags": [],
  39. "prefer-stable": false,
  40. "prefer-lowest": false,
  41. "platform": [],
  42. "platform-dev": []
  43. }
  44. --RUN--
  45. update --with-dependencies whitelisted/pkg
  46. --EXPECT--
  47. Removing old/dependency (1.0.0)
  48. Upgrading whitelisted/pkg (1.0.0 => 1.1.0)