Skip to content

Commit

Permalink
Add failing test for #222
Browse files Browse the repository at this point in the history
  • Loading branch information
reedy committed Nov 24, 2021
1 parent 6ab0202 commit 8e709cf
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
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"
]
}
}
}

0 comments on commit 8e709cf

Please sign in to comment.