1
0
Fork 0

Add failing test case

pull/3446/head
Chris Smith 2014-11-20 15:41:29 +00:00
parent 5edc0925cf
commit 2e40f5f586
3 changed files with 57 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,21 @@ 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;
}
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'])) {