1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Merge remote-tracking branch 'adrianosferreira/package-install-method-cli'

Fixed formatting, and handling of config command to be preferred-install.foo value

Refs #8517
This commit is contained in:
Jordi Boggiano 2020-01-13 18:18:18 +01:00
commit ee3fd0f745
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
2 changed files with 72 additions and 0 deletions

View file

@ -1814,6 +1814,51 @@ class JsonManipulatorTest extends TestCase
', $manipulator->getContents());
}
public function testAddConfigWithPackage() {
$manipulator = new JsonManipulator('{
"repositories": [
{
"type": "package",
"package": {
"authors": [],
"extra": {
"package-xml": "package.xml"
}
}
}
],
"config": {
"platform": {
"php": "5.3.9"
}
}
}');
$this->assertTrue($manipulator->addConfigSetting('preferred-install.my-organization/stable-package', 'dist'));
$this->assertEquals('{
"repositories": [
{
"type": "package",
"package": {
"authors": [],
"extra": {
"package-xml": "package.xml"
}
}
}
],
"config": {
"platform": {
"php": "5.3.9"
},
"preferred-install": {
"my-organization/stable-package": "dist"
}
}
}
', $manipulator->getContents());
}
public function testAddSuggestWithPackage()
{
$manipulator = new JsonManipulator('{