Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/phpunit/MergePluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,27 @@ function ($args, $root) {
$this->triggerPlugin($root->reveal(), $dir, $fireInit);
}

public function testGitHubIssue222()
{
$that = $this;
$dir = $this->fixtureDir(__FUNCTION__);

$root = $this->rootFromJson("{$dir}/composer.json");
$root->setRequires(Argument::type('array'))->will(
function ($args) use ($that) {
$requires = $args[0];
$that->assertCount(2, $requires);
$that->assertArrayHasKey('symfony/yaml', $requires);

$that->assertEquals(
'5.3.6',
$requires['symfony/yaml']->getPrettyConstraint()
);
}
);
$this->triggerPlugin($root->reveal(), $dir);
}

/**
* Generic provider for tests that should be tried with and without an
* INIT event.
Expand Down
5 changes: 5 additions & 0 deletions tests/phpunit/fixtures/testGitHubIssue222/composer-extra.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"symfony/yaml": "5.3.6"
}
}
16 changes: 16 additions & 0 deletions tests/phpunit/fixtures/testGitHubIssue222/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"require": {
"wikimedia/composer-merge-plugin": "dev-master"
},
"require-dev": {
"symfony/yaml": "~3.4|~5.1"
},
"extra": {
"merge-plugin": {
"include": [
"composer.local.json"
],
"merge-dev": false
}
}
}
9 changes: 9 additions & 0 deletions tests/phpunit/fixtures/testGitHubIssue222/composer.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extra": {
"merge-plugin": {
"include": [
"composer-extra.json"
]
}
}
}