provider-dev-require-cannot-satisfy-require.test 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Test that an appropriate error is thrown if a requirement is only satisfied by a package provided by a dependency of a dev requirement.
  3. --COMPOSER--
  4. {
  5. "repositories": [
  6. {
  7. "type": "package",
  8. "package": [
  9. {"name": "provider/requirer", "version": "1.0.0", "type": "metapackage", "require": {"b/b": "1.0.0"}},
  10. {"name": "b/b", "version": "1.0.0", "type": "metapackage", "provide": {"provided/pkg": "1.0.0"}}
  11. ]
  12. }
  13. ],
  14. "require": {
  15. "provided/pkg": "1.0.0"
  16. },
  17. "require-dev": {
  18. "provider/requirer": "1.0.0"
  19. }
  20. }
  21. --RUN--
  22. update
  23. --EXPECT-EXIT-CODE--
  24. 2
  25. --EXPECT-OUTPUT--
  26. Loading composer repositories with package information
  27. Updating dependencies
  28. Unable to find a compatible set of packages based on your non-dev requirements alone.
  29. Your requirements can be resolved successfully when require-dev packages are present.
  30. You may need to move packages from require-dev or some of their dependencies to require.
  31. Problem 1
  32. - Root composer.json requires provided/pkg 1.0.0, it could not be found in any version, but the following packages provide it:
  33. - b/b
  34. Consider requiring one of these to satisfy the provided/pkg requirement.
  35. --EXPECT--