Skip to content

Commit 8e709cf

Browse files
committed
Add failing test for #222
1 parent 6ab0202 commit 8e709cf

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

tests/phpunit/MergePluginTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,27 @@ function ($args, $root) {
15721572
$this->triggerPlugin($root->reveal(), $dir, $fireInit);
15731573
}
15741574

1575+
public function testGitHubIssue222()
1576+
{
1577+
$that = $this;
1578+
$dir = $this->fixtureDir(__FUNCTION__);
1579+
1580+
$root = $this->rootFromJson("{$dir}/composer.json");
1581+
$root->setRequires(Argument::type('array'))->will(
1582+
function ($args) use ($that) {
1583+
$requires = $args[0];
1584+
$that->assertCount(2, $requires);
1585+
$that->assertArrayHasKey('symfony/yaml', $requires);
1586+
1587+
$that->assertEquals(
1588+
'5.3.6',
1589+
$requires['symfony/yaml']->getPrettyConstraint()
1590+
);
1591+
}
1592+
);
1593+
$this->triggerPlugin($root->reveal(), $dir);
1594+
}
1595+
15751596
/**
15761597
* Generic provider for tests that should be tried with and without an
15771598
* INIT event.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"symfony/yaml": "5.3.6"
4+
}
5+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"require": {
3+
"wikimedia/composer-merge-plugin": "dev-master"
4+
},
5+
"require-dev": {
6+
"symfony/yaml": "~3.4|~5.1"
7+
},
8+
"extra": {
9+
"merge-plugin": {
10+
"include": [
11+
"composer.local.json"
12+
],
13+
"merge-dev": false
14+
}
15+
}
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extra": {
3+
"merge-plugin": {
4+
"include": [
5+
"composer-extra.json"
6+
]
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)