1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- --TEST--
- Require a new package in the composer.json and updating with its name as an argument and with-dependencies should remove packages it replaces which are not root requirements
- --COMPOSER--
- {
- "repositories": [
- {
- "type": "package",
- "package": [
- { "name": "current/pkg", "version": "1.0.0", "require": { "mutual/target": "*", "mutual/target-provide": "*" } },
- { "name": "current/dep", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
- { "name": "new/pkg", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
- { "name": "current/dep-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } },
- { "name": "new/pkg-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } }
- ]
- }
- ],
- "require": {
- "current/pkg": "1.*",
- "new/pkg": "1.*",
- "new/pkg-provide": "1.*"
- }
- }
- --INSTALLED--
- [
- { "name": "current/pkg", "version": "1.0.0", "require": { "mutual/target": "*" } },
- { "name": "current/dep", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
- { "name": "current/dep-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } }
- ]
- --LOCK--
- {
- "packages": [
- { "name": "current/pkg", "version": "1.0.0", "require": { "mutual/target": "*" } },
- { "name": "current/dep", "version": "1.0.0", "replace": { "mutual/target": "1.0.0" } },
- { "name": "current/dep-provide", "version": "1.0.0", "provide": { "mutual/target-provide": "1.0.0" } }
- ],
- "packages-dev": [],
- "aliases": [],
- "minimum-stability": "dev",
- "stability-flags": [],
- "prefer-stable": false,
- "prefer-lowest": false,
- "platform": [],
- "platform-dev": []
- }
- --RUN--
- update new/pkg --with-dependencies
- --EXPECT--
- Removing current/dep (1.0.0)
- Installing new/pkg (1.0.0)
- Installing new/pkg-provide (1.0.0)
|