commit
edd4b2f984
|
@ -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)
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -283,6 +283,22 @@ class InstallerTest extends TestCase
|
|||
$message = $match['test'];
|
||||
$condition = !empty($match['condition']) ? $match['condition'] : null;
|
||||
$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'])) {
|
||||
$lock = JsonFile::parseJson($match['lock']);
|
||||
if (!isset($lock['hash'])) {
|
||||
|
|
Loading…
Reference in New Issue