github-issues-4795.test 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --TEST--
  2. See Github issue #4795 ( github.com/composer/composer/issues/4795 ).
  3. Composer\Installer::whitelistUpdateDependencies intentionally ignores root requirements even if said package is also a
  4. dependency of one the requirements that is whitelisted for update.
  5. --COMPOSER--
  6. {
  7. "repositories": [
  8. {
  9. "type": "package",
  10. "package": [
  11. { "name": "a/a", "version": "1.0.0" },
  12. { "name": "a/a", "version": "1.1.0" },
  13. { "name": "b/b", "version": "1.0.0", "require": { "a/a": "~1.0" } },
  14. { "name": "b/b", "version": "1.1.0", "require": { "a/a": "~1.1" } }
  15. ]
  16. }
  17. ],
  18. "require": {
  19. "a/a": "~1.0",
  20. "b/b": "~1.0"
  21. }
  22. }
  23. --INSTALLED--
  24. [
  25. { "name": "a/a", "version": "1.0.0" },
  26. { "name": "b/b", "version": "1.0.0", "require": { "a/a": "~1.0" } }
  27. ]
  28. --LOCK--
  29. {
  30. "packages": [
  31. { "name": "a/a", "version": "1.0.0" },
  32. { "name": "b/b", "version": "1.0.0", "require": { "a/a": "~1.0" } }
  33. ],
  34. "packages-dev": [],
  35. "aliases": [],
  36. "minimum-stability": "dev",
  37. "stability-flags": [],
  38. "prefer-stable": false,
  39. "prefer-lowest": false,
  40. "platform": [],
  41. "platform-dev": []
  42. }
  43. --RUN--
  44. update b/b --with-dependencies
  45. --EXPECT-OUTPUT--
  46. Loading composer repositories with package information
  47. Updating dependencies
  48. <warning>Dependency "a/a" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies to include root dependencies.</warning>
  49. Nothing to modify in lock file
  50. Writing lock file
  51. Installing dependencies from lock file (including require-dev)
  52. Nothing to install, update or remove
  53. Generating autoload files
  54. --EXPECT--