1
0
Fork 0
composer/tests/Composer/Test/Fixtures/installer
Nils Adermann 6b2edeae56 Fix solver problem exceptions with unexpected contradictory "Conclusions"
This 5 character fix comes with a solver test as well as a functional
installer test essentially verifying the same thing. The solver test is
more useful when working on the solver. But the functional test is less
likely to be accidentally modified incorrectly during refactoring, as
every single package, version and link in the rather complex test
scenario is essential, and a modified version of the test may very well
still result in a successful installation but no longer verify the bug
described below.

Background:

In commit 451bab1c2c from May 19, 2012 I
refactored literals from complex objects into pure integers to reduce
memory consumption. The absolute value of an integer literal is the id
of the package it refers to in the package pool. The sign indicates
whether the package should be installed (positive) or removed (negative),

So a major part of the refactoring was swapping this call:

$literal->getPackageId()

For this:

abs($literal)

Unintentionally in line 554/523 I incorrectly applied this change to the
line:

$this->literalFromId(-$literal->getPackageId());

It was converted to:

-abs($literal);

The function literalFromId used to create a new literal object. By using
the abs() function this change essentially forces the resulting literal
to be negative, while the minus sign previously inverted the literal, so
positive into negative and vice versa.

This particular line is in a function meant to analyze a conflicting
decision during dependency resolution and to draw a conclusion from it,
then revert the state of the solver to an earlier position, and attempt
to solve the rest of the rules again with this new "learned" conclusion.

Because of this bug these conclusions could only ever occur in the
negative, e.g. "don't install package X". This is by far the most likely
scenario when the solver reaches this particular line, but there are
exceptions.

If you experienced a solver problem description that contained a
statement like "Conclusion: don't install vendor/package 1.2.3" which
directly contradicted other statements listed as part of the problem,
this could likely have been the cause.
2019-02-03 16:33:55 +01:00
..
install-branch-alias-composer-repo Add failing test case 2014-11-20 16:54:38 +00:00
SAMPLE Refactor functional tests to fit existing tests better 2012-08-14 01:16:40 +02:00
abandoned-listed.test added more information in the output 2016-10-29 11:37:23 -07:00
alias-with-reference.test Fix support of aliases combined with reference locked packages, fixes #1631 2013-02-28 10:51:21 +01:00
aliased-priority-conflicting.test Change default minimum-stability to "stable", fixes #744 2012-07-04 14:22:09 +02:00
aliased-priority.test Change default minimum-stability to "stable", fixes #744 2012-07-04 14:22:09 +02:00
broken-deps-do-not-replace.test Update tests of solver problem message to match new message 2017-11-16 12:41:41 +01:00
circular-dependency.test Adjust circular dep test 2013-04-30 10:34:58 +02:00
circular-dependency2.test Ignore self references when anlaysing independent root requirements 2016-03-02 13:03:26 +01:00
disjunctive-multi-constraints.test Add disjunctive multi-constraints with |, refs #643, fixes #1342 2013-04-27 15:20:35 +02:00
github-issues-4319.test Warn on invalid package name or require/provide/.., fixes #7874 2019-01-29 13:46:23 +01:00
github-issues-4795-2.test Warn on invalid package name or require/provide/.., fixes #7874 2019-01-29 13:46:23 +01:00
github-issues-4795.test Warn on invalid package name or require/provide/.., fixes #7874 2019-01-29 13:46:23 +01:00
install-aliased-alias.test Added support for the alias of an aliased package 2013-04-11 13:20:34 +02:00
install-branch-alias-composer-repo.test Add failing test case 2014-11-20 16:54:38 +00:00
install-dev-using-dist.test Persist prefer-lowest in composer.lock 2014-12-14 10:29:41 +01:00
install-dev.test Fix integration tests 2014-04-07 11:10:57 +02:00
install-from-empty-lock.test Persist prefer-lowest in composer.lock 2014-12-14 10:29:41 +01:00
install-from-lock-removes-package.test Add test to verify that depency packages get deleted when no longer in lock file 2014-11-26 20:24:30 +01:00
install-ignore-platform-package-requirements.test Add tests for platform packages required by root and avoid creating rules altogether instead of disabling them, refs #3320 2014-10-17 15:30:27 +01:00
install-missing-alias-from-lock.test Persist prefer-lowest in composer.lock 2014-12-14 10:29:41 +01:00
install-overridden-platform-packages.test Finalize platform override feature 2015-04-29 22:38:07 +01:00
install-package-and-its-provider-skips-original.test Add test for replace 2015-05-05 11:07:11 +01:00
install-prefers-repos-over-package-versions.test Prioritize repository over package versions in the default policy, fixes #3509 2015-04-30 10:43:04 +01:00
install-reference.test Refactor integration tests to accept any run command 2012-05-28 00:11:18 +02:00
install-self-from-root.test Cleaner notation for expected exceptions in fixtures. 2016-01-27 13:46:14 +01:00
install-simple.test Refactor integration tests to accept any run command 2012-05-28 00:11:18 +02:00
partial-update-downgrades-non-whitelisted-unstable.test Fix partial updates from a dirty state and apply exactly the locked state, fixes #3468 2016-04-18 23:33:04 +01:00
partial-update-forces-dev-reference-from-lock-for-non-updated-packages.test Partial updates should not corrupt the lock if the installed repo is not up to date with it, fixes #3439, closes #3553 2015-04-30 16:39:08 +01:00
partial-update-from-lock.test Fix partial updates from a dirty state and apply exactly the locked state, fixes #3468 2016-04-18 23:33:04 +01:00
partial-update-installs-from-lock-even-missing.test Partial updates should not corrupt the lock if the installed repo is not up to date with it, fixes #3439, closes #3553 2015-04-30 16:39:08 +01:00
partial-update-without-lock.test Persist prefer-lowest in composer.lock 2014-12-14 10:29:41 +01:00
plugins-are-installed-first.test Move plugins with no dependencies to the front, followed by plugins with their dependencies 2017-05-23 20:28:32 -04:00
replace-alias.test fix "replace-alias.test" test 2014-03-12 16:35:04 +01:00
replace-priorities.test Fix replacers being picked if whatProvide was called before building the package whitelist, fixes #2991, fixes #2962 2014-05-23 15:22:53 +02:00
replace-root-require.test Add tests for the changes in #2690 2014-02-21 13:15:07 +01:00
replaced-packages-should-not-be-installed-when-installing-from-lock.test Update tests for replace conflicts 2018-08-27 12:14:34 +02:00
replaced-packages-should-not-be-installed.test Update tests for replace conflicts 2018-08-27 12:14:34 +02:00
root-requirements-do-not-affect-locked-versions.test removed requirements from the root package should we install from the lock file 2015-02-13 16:15:34 +01:00
solver-problems.test Warn on invalid package name or require/provide/.., fixes #7874 2019-01-29 13:46:23 +01:00
suggest-installed.test added more information in the output 2016-10-29 11:37:23 -07:00
suggest-prod.test added more information in the output 2016-10-29 11:37:23 -07:00
suggest-replaced.test added more information in the output 2016-10-29 11:37:23 -07:00
suggest-uninstalled.test added more information in the output 2016-10-29 11:37:23 -07:00
update-alias-lock.test Partial updates should not corrupt the lock if the installed repo is not up to date with it, fixes #3439, closes #3553 2015-04-30 16:39:08 +01:00
update-alias.test Add test for updating an aliased package to a non-aliased one 2012-07-01 17:41:16 +02:00
update-all-dry-run.test Fix integration tests 2014-04-07 11:10:57 +02:00
update-all.test Fix integration tests 2014-04-07 11:10:57 +02:00
update-changes-url.test Fix #refs handling, fixes #5291 2016-05-10 17:17:08 +01:00
update-dev-ignores-providers.test Fix regression in updating dev packages to latest ref, fixes #1030 2012-08-27 12:03:07 +02:00
update-dev-packages-updates-repo-url.test Check if package URLs are up to date after an update op is done, fixes #3214 2015-04-30 16:41:28 +01:00
update-dev-to-new-ref-picks-up-changes.test Fix updates when dev packages have new dependencies (no more double updates needed), fixes #1105 2012-11-22 22:47:19 +01:00
update-downgrades-unstable-packages.test Handle stability changes correctly, fixes #877 2013-03-10 19:55:26 +01:00
update-ignore-platform-package-requirements.test Add tests for platform packages required by root and avoid creating rules altogether instead of disabling them, refs #3320 2014-10-17 15:30:27 +01:00
update-installed-alias-dry-run.test Fixed update alias packages in dry-run mode 2013-04-11 13:20:35 +02:00
update-installed-alias.test Fixed update alias packages in dry-run mode 2013-04-11 13:20:35 +02:00
update-installed-reference-dry-run.test added tests for not updating packages referenced by specific commit hash 2014-05-27 14:23:31 +02:00
update-installed-reference.test added tests for not updating packages referenced by specific commit hash 2014-05-27 14:23:31 +02:00
update-no-dev-still-resolves-dev.test Always resolve dev packages even when doing an update with --no-dev, fixes #5016 2016-04-20 12:34:04 +01:00
update-picks-up-change-of-vcs-type.test Add test 2015-09-18 15:31:54 +02:00
update-prefer-lowest-stable.test split update --prefer-lowest and --prefer-stable 2014-12-13 11:51:30 +01:00
update-reference.test Refactor integration tests to accept any run command 2012-05-28 00:11:18 +02:00
update-requiring-decision-reverts-and-learning-positive-literals.test Fix solver problem exceptions with unexpected contradictory "Conclusions" 2019-02-03 16:33:55 +01:00
update-syncs-outdated.test Make sure the abandoned state is copied over even if the packages are installed already 2016-04-22 23:41:15 +01:00
update-whitelist-locked-require.test Change dependency processing for update with whitelisted packages 2013-10-16 09:37:14 +02:00
update-whitelist-patterns-with-all-dependencies.test Fix update whitelist pattern resolving and add more tests 2019-01-28 17:34:24 +01:00
update-whitelist-patterns-with-dependencies.test Fix update whitelist pattern resolving and add more tests 2019-01-28 17:34:24 +01:00
update-whitelist-patterns-with-root-dependencies.test Fix update whitelist pattern resolving and add more tests 2019-01-28 17:34:24 +01:00
update-whitelist-patterns-without-dependencies.test Fix update whitelist pattern resolving and add more tests 2019-01-28 17:34:24 +01:00
update-whitelist-patterns.test Fix integration tests 2014-04-07 11:10:57 +02:00
update-whitelist-reads-lock.test Partial updates should not corrupt the lock if the installed repo is not up to date with it, fixes #3439, closes #3553 2015-04-30 16:39:08 +01:00
update-whitelist-removes-unused.test Add test case for removing unused dependencies on whitelisted update 2014-11-26 20:19:37 +01:00
update-whitelist-with-dependencies.test Change dependency processing for update with whitelisted packages 2013-10-16 09:37:14 +02:00
update-whitelist-with-dependency-conflict.test Change dependency processing for update with whitelisted packages 2013-10-16 09:37:14 +02:00
update-whitelist.test Change dependency processing for update with whitelisted packages 2013-10-16 09:37:14 +02:00
update-with-all-dependencies.test Warn on invalid package name or require/provide/.., fixes #7874 2019-01-29 13:46:23 +01:00
updating-dev-from-lock-removes-old-deps.test Persist prefer-lowest in composer.lock 2014-12-14 10:29:41 +01:00
updating-dev-updates-url-and-reference.test Persist prefer-lowest in composer.lock 2014-12-14 10:29:41 +01:00