1
0
Fork 0

Merge pull request #3446 from cs278/issue-3444

Failing test case for #3444
pull/3264/head
Nils Adermann 2014-11-20 18:12:22 +01:00
commit edd4b2f984
3 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,19 @@
--TEST--
Installing branch aliased package from a Composer repository.
--COMPOSER--
{
"repositories": [
{
"type": "composer",
"url": "file://install-branch-alias-composer-repo"
}
],
"require": {
"a/a": "3.2.*@dev"
}
}
--RUN--
install
--EXPECT--
Installing a/a (dev-foobar abcdef0)
Marking a/a (3.2.x-dev abcdef0) as installed, alias of a/a (dev-foobar abcdef0)

View File

@ -0,0 +1,23 @@
{
"packages": {
"a/a": {
"dev-foobar": {
"name": "a/a",
"version": "dev-foobar",
"version_normalized": "dev-foobar",
"source": {
"type": "git",
"url": "git@example.com:repo.git",
"reference": "abcdef0000000000000000000000000000000000"
},
"time": "2014-11-13 11:52:12",
"type": "library",
"extra": {
"branch-alias": {
"dev-foobar": "3.2.x-dev"
}
}
}
}
}
}

View File

@ -283,6 +283,22 @@ class InstallerTest extends TestCase
$message = $match['test']; $message = $match['test'];
$condition = !empty($match['condition']) ? $match['condition'] : null; $condition = !empty($match['condition']) ? $match['condition'] : null;
$composer = JsonFile::parseJson($match['composer']); $composer = JsonFile::parseJson($match['composer']);
if (isset($composer['repositories'])) {
foreach ($composer['repositories'] as &$repo) {
if ($repo['type'] !== 'composer') {
continue;
}
// Change paths like file://foobar to file:///path/to/fixtures
if (preg_match('{^file://[^/]}', $repo['url'])) {
$repo['url'] = "file://${fixturesDir}/" . substr($repo['url'], 7);
}
unset($repo);
}
}
if (!empty($match['lock'])) { if (!empty($match['lock'])) {
$lock = JsonFile::parseJson($match['lock']); $lock = JsonFile::parseJson($match['lock']);
if (!isset($lock['hash'])) { if (!isset($lock['hash'])) {