provider-conflicts.test 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --TEST--
  2. Test that names provided by a dependent and root package cause a conflict only for replace
  3. --COMPOSER--
  4. {
  5. "version": "1.2.3",
  6. "repositories": [
  7. {
  8. "type": "package",
  9. "package": [
  10. {
  11. "name": "provider/pkg",
  12. "version": "1.0.0",
  13. "provide": { "root-provided/transitive-provided": "2.*", "root-replaced/transitive-provided": "2.*" },
  14. "replace": { "root-provided/transitive-replaced": "2.*", "root-replaced/transitive-replaced": "2.*" }
  15. }
  16. ]
  17. }
  18. ],
  19. "require": {
  20. "provider/pkg": "*"
  21. },
  22. "provide": {
  23. "root-provided/transitive-replaced": "2.*",
  24. "root-provided/transitive-provided": "2.*"
  25. },
  26. "replace": {
  27. "root-replaced/transitive-replaced": "2.*",
  28. "root-replaced/transitive-provided": "2.*"
  29. }
  30. }
  31. --RUN--
  32. update
  33. --EXPECT-EXIT-CODE--
  34. 2
  35. --EXPECT-OUTPUT--
  36. Loading composer repositories with package information
  37. Updating dependencies
  38. Your requirements could not be resolved to an installable set of packages.
  39. Problem 1
  40. - __root__ is present at version 1.2.3 and cannot be modified by Composer
  41. - provider/pkg[1.0.0] cannot be installed as that would require removing __root__[1.2.3]. They both replace root-replaced/transitive-replaced and thus cannot coexist.
  42. - Root composer.json requires provider/pkg * -> satisfiable by provider/pkg[1.0.0].
  43. --EXPECT--