aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/tests/installer.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-03 16:34:10 +0900
committernsfisis <nsfisis@gmail.com>2026-05-03 16:34:10 +0900
commit9eecfe303c944c80556b0b25fcd3ce6bbce3aeb8 (patch)
treedc195bda8422447fe9cd762120a850ba726be529 /crates/mozart/tests/installer.rs
parentd84024fb179e3ebb55573971a329cb6ff72d7fa0 (diff)
downloadphp-mozart-9eecfe303c944c80556b0b25fcd3ce6bbce3aeb8.tar.gz
php-mozart-9eecfe303c944c80556b0b25fcd3ce6bbce3aeb8.tar.zst
php-mozart-9eecfe303c944c80556b0b25fcd3ce6bbce3aeb8.zip
fix(install): reject locks where two packages claim the same name
Mirror Composer's `RuleSetGenerator::addConflictRules` SAME_NAME pass on the locked package set: a package's `getNames(false)` is its canonical name plus the names it claims via `replace`, and any name with two providers makes the lock-verify solve unsatisfiable. Mozart's `install` skips that solve, so the conflict slipped through and both packages were installed; surface it explicitly and exit DEPENDENCY_RESOLUTION_FAILED. `provide` targets are deliberately excluded — `getNames(false)` excludes them, since multiple providers of a virtual name may co-exist. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/tests/installer.rs')
-rw-r--r--crates/mozart/tests/installer.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs
index 4c877cc..cb7f430 100644
--- a/crates/mozart/tests/installer.rs
+++ b/crates/mozart/tests/installer.rs
@@ -332,10 +332,7 @@ installer_fixture!(replace_priorities);
installer_fixture!(replace_range_require_single_version);
installer_fixture!(replace_root_require);
installer_fixture!(replaced_packages_should_not_be_installed);
-installer_fixture!(
- replaced_packages_should_not_be_installed_when_installing_from_lock,
- ignore
-);
+installer_fixture!(replaced_packages_should_not_be_installed_when_installing_from_lock);
installer_fixture!(replacer_satisfies_its_own_requirement);
installer_fixture!(repositories_priorities);
installer_fixture!(repositories_priorities2);