github-issues-4795.test 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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", "version": "1.0.0" },
  12. { "name": "a", "version": "1.1.0" },
  13. { "name": "b", "version": "1.0.0", "require": { "a": "~1.0" } },
  14. { "name": "b", "version": "1.1.0", "require": { "a": "~1.1" } },
  15. { "name": "c", "version": "1.0.0", "require": { "a": "~1.0" } }
  16. ]
  17. }
  18. ],
  19. "require": {
  20. "a": "~1.0",
  21. "b": "~1.0",
  22. "c": "~1.0"
  23. }
  24. }
  25. --INSTALLED--
  26. [
  27. { "name": "a", "version": "1.0.0" },
  28. { "name": "b", "version": "1.0.0", "require": { "a": "~1.0" } },
  29. { "name": "c", "version": "1.0.0", "require": { "a": "~1.0" } }
  30. ]
  31. --RUN--
  32. update B --with-dependencies
  33. --EXPECT-OUTPUT--
  34. <warning>Dependency "a" is also a root requirement, but is not explicitly whitelisted. Ignoring.</warning>
  35. Loading composer repositories with package information
  36. Updating dependencies (including require-dev)
  37. Nothing to install or update
  38. Writing lock file
  39. Generating autoload files
  40. --EXPECT--