Allow defining multiple reppos in pool builder tests
parent
9a04ecefbf
commit
fcb9ef4899
|
@ -26,29 +26,31 @@ Check root aliases are loaded
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{
|
||||
"name": "req/pkg", "version": "dev-feature-foo",
|
||||
"source": { "reference": "feat.f", "type": "git", "url": "" }
|
||||
},
|
||||
{
|
||||
"name": "req/pkg", "version": "dev-master",
|
||||
"extra": { "branch-alias": { "dev-master": "1.0.x-dev" } },
|
||||
"source": { "reference": "forked", "type": "git", "url": "" },
|
||||
"default-branch": true
|
||||
},
|
||||
{
|
||||
"name": "req/pkg", "version": "dev-master",
|
||||
"extra": { "branch-alias": { "dev-master": "1.0.x-dev" } },
|
||||
"source": { "reference": "master", "type": "git", "url": "" },
|
||||
"default-branch": true
|
||||
},
|
||||
{
|
||||
"name": "package/a", "version": "dev-master",
|
||||
"require": { "req/pkg": "dev-master" },
|
||||
"default-branch": true
|
||||
}
|
||||
[
|
||||
{
|
||||
"name": "req/pkg", "version": "dev-feature-foo",
|
||||
"source": { "reference": "feat.f", "type": "git", "url": "" }
|
||||
},
|
||||
{
|
||||
"name": "req/pkg", "version": "dev-master",
|
||||
"extra": { "branch-alias": { "dev-master": "1.0.x-dev" } },
|
||||
"source": { "reference": "forked", "type": "git", "url": "" },
|
||||
"default-branch": true
|
||||
},
|
||||
{
|
||||
"name": "req/pkg", "version": "dev-master",
|
||||
"extra": { "branch-alias": { "dev-master": "1.0.x-dev" } },
|
||||
"source": { "reference": "master", "type": "git", "url": "" },
|
||||
"default-branch": true
|
||||
},
|
||||
{
|
||||
"name": "package/a", "version": "dev-master",
|
||||
"require": { "req/pkg": "dev-master" },
|
||||
"default-branch": true
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -31,21 +31,23 @@ Check root aliases get selected correctly
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{
|
||||
"name": "a/aliased", "version": "dev-master",
|
||||
"source": { "reference": "orig", "type": "git", "url": "" },
|
||||
"default-branch": true
|
||||
},
|
||||
{
|
||||
"name": "a/aliased", "version": "1.0"
|
||||
},
|
||||
{
|
||||
"name": "b/requirer", "version": "1.0.0",
|
||||
"require": { "a/aliased": "1.0.0" },
|
||||
"source": { "reference": "1.0.0", "type": "git", "url": "" }
|
||||
}
|
||||
[
|
||||
{
|
||||
"name": "a/aliased", "version": "dev-master",
|
||||
"source": { "reference": "orig", "type": "git", "url": "" },
|
||||
"default-branch": true
|
||||
},
|
||||
{
|
||||
"name": "a/aliased", "version": "1.0"
|
||||
},
|
||||
{
|
||||
"name": "b/requirer", "version": "1.0.0",
|
||||
"require": { "a/aliased": "1.0.0" },
|
||||
"source": { "reference": "1.0.0", "type": "git", "url": "" }
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -12,12 +12,14 @@ Tests if version constraint is expanded. If not, dep/dep 3.0.0 would not be load
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.3.4"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep2": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.5"},
|
||||
{"name": "dep/dep2", "version": "2.3.4", "require": {"dep/dep": "2.*"}}
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.3.4"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep2": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.5"},
|
||||
{"name": "dep/dep2", "version": "2.3.4", "require": {"dep/dep": "2.*"}}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -15,14 +15,16 @@ Fixed packages do not get loaded from the repos
|
|||
{"name": "dep/dep", "version": "2.1.5", "id": 2}
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "some/pkg", "version": "1.0.0"},
|
||||
{"name": "some/pkg", "version": "1.1.0"},
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/req", "version": "2.0.0", "require": {"dep/dep": "3.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4"},
|
||||
{"name": "dep/dep", "version": "3.0.1"}
|
||||
[
|
||||
{"name": "some/pkg", "version": "1.0.0"},
|
||||
{"name": "some/pkg", "version": "1.1.0"},
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/req", "version": "2.0.0", "require": {"dep/dep": "3.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4"},
|
||||
{"name": "dep/dep", "version": "3.0.1"}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -14,13 +14,15 @@ Packages replaced by fixed packages do not get loaded from the repos
|
|||
{"name": "some/pkg", "version": "1.0.3", "replace": {"dep/dep": "2.1.0"}, "id": 1}
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "some/pkg", "version": "1.0.0"},
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/req", "version": "2.0.0", "require": {"dep/dep": "3.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4"},
|
||||
{"name": "dep/dep", "version": "3.0.1"}
|
||||
[
|
||||
{"name": "some/pkg", "version": "1.0.0"},
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/req", "version": "2.0.0", "require": {"dep/dep": "3.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4"},
|
||||
{"name": "dep/dep", "version": "3.0.1"}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -12,14 +12,16 @@ Tests if version constraint is expanded. If not, dep/dep 3.0.0 would not be load
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep2": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.5"},
|
||||
{"name": "dep/dep", "version": "3.0.0"},
|
||||
{"name": "dep/dep", "version": "4.0.0"},
|
||||
{"name": "dep/dep2", "version": "2.3.4", "require": {"dep/dep": "3.*"}}
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep2": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.5"},
|
||||
{"name": "dep/dep", "version": "3.0.0"},
|
||||
{"name": "dep/dep", "version": "4.0.0"},
|
||||
{"name": "dep/dep2", "version": "2.3.4", "require": {"dep/dep": "3.*"}}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -12,13 +12,15 @@ Test irrelevant package versions are not loaded recursively
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep2": "2.*"}},
|
||||
{"name": "dep/dep", "version": "3.0.1"},
|
||||
{"name": "dep/dep2", "version": "2.3.4"},
|
||||
{"name": "dep/dep2", "version": "3.0.1"}
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep2": "2.*"}},
|
||||
{"name": "dep/dep", "version": "3.0.1"},
|
||||
{"name": "dep/dep2", "version": "2.3.4"},
|
||||
{"name": "dep/dep2", "version": "3.0.1"}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -12,10 +12,12 @@ Test package is not found
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep3": "2.*"}}
|
||||
[
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4", "require": {"dep/dep3": "2.*"}}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -23,16 +23,18 @@ Partially updating one root requirement with transitive deps without root requir
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "root/update", "version": "1.0.4", "require": {"dep/dep": "1.*", "dep2/dep2": "1.*"}},
|
||||
{"name": "root/update", "version": "1.0.5", "require": {"dep/dep": "2.*", "dep2/dep2": "2.*"}},
|
||||
{"name": "root/fix", "version": "1.0.6"},
|
||||
{"name": "root/fix", "version": "2.0.7"},
|
||||
{"name": "dep/dep", "version": "1.0.8", "require": {"root/fix": "1.*"}},
|
||||
{"name": "dep/dep", "version": "2.0.9", "require": {"root/fix": "2.*"}},
|
||||
{"name": "dep2/dep2", "version": "1.0.8", "require": {"dep/dep": "1.*"}},
|
||||
{"name": "dep2/dep2", "version": "2.0.9", "require": {"dep/dep": "2.*"}}
|
||||
[
|
||||
{"name": "root/update", "version": "1.0.4", "require": {"dep/dep": "1.*", "dep2/dep2": "1.*"}},
|
||||
{"name": "root/update", "version": "1.0.5", "require": {"dep/dep": "2.*", "dep2/dep2": "2.*"}},
|
||||
{"name": "root/fix", "version": "1.0.6"},
|
||||
{"name": "root/fix", "version": "2.0.7"},
|
||||
{"name": "dep/dep", "version": "1.0.8", "require": {"root/fix": "1.*"}},
|
||||
{"name": "dep/dep", "version": "2.0.9", "require": {"root/fix": "2.*"}},
|
||||
{"name": "dep2/dep2", "version": "1.0.8", "require": {"dep/dep": "1.*"}},
|
||||
{"name": "dep2/dep2", "version": "2.0.9", "require": {"dep/dep": "2.*"}}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -24,16 +24,18 @@ Partially updating one root requirement with transitive deps fully updates anoth
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "root/update", "version": "1.0.4", "require": {"dep/dep": "1.*"}},
|
||||
{"name": "root/update", "version": "1.0.5", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/dep", "version": "1.0.6"},
|
||||
{"name": "root/dep", "version": "2.0.7"},
|
||||
{"name": "root/dep2", "version": "1.0.6"},
|
||||
{"name": "root/dep2", "version": "2.0.7"},
|
||||
{"name": "dep/dep", "version": "1.0.8", "require": {"root/dep": "1.*", "root/dep2": "1.*"}},
|
||||
{"name": "dep/dep", "version": "2.0.9", "require": {"root/dep": "2.*", "root/dep2": "2.*"}}
|
||||
[
|
||||
{"name": "root/update", "version": "1.0.4", "require": {"dep/dep": "1.*"}},
|
||||
{"name": "root/update", "version": "1.0.5", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/dep", "version": "1.0.6"},
|
||||
{"name": "root/dep", "version": "2.0.7"},
|
||||
{"name": "root/dep2", "version": "1.0.6"},
|
||||
{"name": "root/dep2", "version": "2.0.7"},
|
||||
{"name": "dep/dep", "version": "1.0.8", "require": {"root/dep": "1.*", "root/dep2": "1.*"}},
|
||||
{"name": "dep/dep", "version": "2.0.9", "require": {"root/dep": "2.*", "root/dep2": "2.*"}}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -23,18 +23,20 @@ Fixed packages and replacers get unfixed correctly (refs https://github.com/comp
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "root/req1", "version": "1.0.0", "require": {"replacer/pkg": "1.*"}},
|
||||
{"name": "root/req1", "version": "1.1.0", "require": {"replacer/pkg": "1.*"}},
|
||||
{"name": "root/req3", "version": "1.0.0", "require": {"replaced/pkg": "1.*"}},
|
||||
{"name": "root/req3", "version": "1.1.0", "require": {"replaced/pkg": "1.*"}},
|
||||
{"name": "replacer/pkg", "version": "1.0.0", "replace": {"replaced/pkg": "*"}},
|
||||
{"name": "replacer/pkg", "version": "1.1.0", "replace": {"replaced/pkg": "*"}},
|
||||
{"name": "replaced/pkg", "version": "1.2.3"},
|
||||
{"name": "replaced/pkg", "version": "1.2.4"},
|
||||
{"name": "dep/dep", "version": "2.3.5"},
|
||||
{"name": "dep/dep", "version": "2.3.6"}
|
||||
[
|
||||
{"name": "root/req1", "version": "1.0.0", "require": {"replacer/pkg": "1.*"}},
|
||||
{"name": "root/req1", "version": "1.1.0", "require": {"replacer/pkg": "1.*"}},
|
||||
{"name": "root/req3", "version": "1.0.0", "require": {"replaced/pkg": "1.*"}},
|
||||
{"name": "root/req3", "version": "1.1.0", "require": {"replaced/pkg": "1.*"}},
|
||||
{"name": "replacer/pkg", "version": "1.0.0", "replace": {"replaced/pkg": "*"}},
|
||||
{"name": "replacer/pkg", "version": "1.1.0", "replace": {"replaced/pkg": "*"}},
|
||||
{"name": "replaced/pkg", "version": "1.2.3"},
|
||||
{"name": "replaced/pkg", "version": "1.2.4"},
|
||||
{"name": "dep/dep", "version": "2.3.5"},
|
||||
{"name": "dep/dep", "version": "2.3.6"}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -20,13 +20,15 @@ Partially updating a root requirement without deps, still selects a new dependen
|
|||
[
|
||||
]
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "some/pkg", "version": "1.0.4"},
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/req", "version": "2.0.0", "require": {"dep/dep": "3.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4"},
|
||||
{"name": "dep/dep", "version": "3.0.1"}
|
||||
[
|
||||
{"name": "some/pkg", "version": "1.0.4"},
|
||||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}},
|
||||
{"name": "root/req", "version": "2.0.0", "require": {"dep/dep": "3.*"}},
|
||||
{"name": "dep/dep", "version": "2.3.4"},
|
||||
{"name": "dep/dep", "version": "3.0.1"}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -24,15 +24,17 @@ Stability flags apply
|
|||
}
|
||||
}
|
||||
|
||||
--PACKAGES--
|
||||
--PACKAGE-REPOS--
|
||||
[
|
||||
{"name": "flagged/pkg", "version": "1.0.0", "id": 1},
|
||||
{"name": "flagged/pkg", "version": "1.0.0-beta", "id": 2},
|
||||
{"name": "flagged/pkg", "version": "1.0.0-dev", "id": 3},
|
||||
{"name": "flagged/pkg", "version": "1.0.0-RC", "id": 4},
|
||||
{"name": "default/pkg", "version": "1.0.0", "id": 5},
|
||||
{"name": "default/pkg", "version": "1.0.0-RC", "id": 6},
|
||||
{"name": "default/pkg", "version": "1.0.0-alpha", "id": 7}
|
||||
[
|
||||
{"name": "flagged/pkg", "version": "1.0.0", "id": 1},
|
||||
{"name": "flagged/pkg", "version": "1.0.0-beta", "id": 2},
|
||||
{"name": "flagged/pkg", "version": "1.0.0-dev", "id": 3},
|
||||
{"name": "flagged/pkg", "version": "1.0.0-RC", "id": 4},
|
||||
{"name": "default/pkg", "version": "1.0.0", "id": 5},
|
||||
{"name": "default/pkg", "version": "1.0.0-RC", "id": 6},
|
||||
{"name": "default/pkg", "version": "1.0.0-alpha", "id": 7}
|
||||
]
|
||||
]
|
||||
|
||||
--EXPECT--
|
||||
|
|
|
@ -36,7 +36,7 @@ class PoolBuilderTest extends TestCase
|
|||
/**
|
||||
* @dataProvider getIntegrationTests
|
||||
*/
|
||||
public function testPoolBuilder($file, $message, $expect, $root, $requestData, $packages, $fixed)
|
||||
public function testPoolBuilder($file, $message, $expect, $root, $requestData, $packageRepos, $fixed)
|
||||
{
|
||||
$rootAliases = !empty($root['aliases']) ? $root['aliases'] : array();
|
||||
$minimumStability = !empty($root['minimum-stability']) ? $root['minimum-stability'] : 'stable';
|
||||
|
@ -73,11 +73,13 @@ class PoolBuilderTest extends TestCase
|
|||
};
|
||||
|
||||
$repositorySet = new RepositorySet($minimumStability, $stabilityFlags, $rootAliases, $rootReferences);
|
||||
$repositorySet->addRepository($repo = new ArrayRepository());
|
||||
$repositorySet->addRepository($lockedRepo = new LockArrayRepository());
|
||||
foreach ($packages as $package) {
|
||||
$repo->addPackage($loadPackage($package));
|
||||
foreach ($packageRepos as $packages) {
|
||||
$repositorySet->addRepository($repo = new ArrayRepository());
|
||||
foreach ($packages as $package) {
|
||||
$repo->addPackage($loadPackage($package));
|
||||
}
|
||||
}
|
||||
$repositorySet->addRepository($lockedRepo = new LockArrayRepository());
|
||||
|
||||
if (isset($requestData['locked'])) {
|
||||
foreach ($requestData['locked'] as $package) {
|
||||
|
@ -153,7 +155,7 @@ class PoolBuilderTest extends TestCase
|
|||
$request = JsonFile::parseJson($testData['REQUEST']);
|
||||
$root = !empty($testData['ROOT']) ? JsonFile::parseJson($testData['ROOT']) : array();
|
||||
|
||||
$packages = JsonFile::parseJson($testData['PACKAGES']);
|
||||
$packageRepos = JsonFile::parseJson($testData['PACKAGE-REPOS']);
|
||||
$fixed = array();
|
||||
if (!empty($testData['FIXED'])) {
|
||||
$fixed = JsonFile::parseJson($testData['FIXED']);
|
||||
|
@ -163,7 +165,7 @@ class PoolBuilderTest extends TestCase
|
|||
die(sprintf('Test "%s" is not valid: '.$e->getMessage(), str_replace($fixturesDir.'/', '', $file)));
|
||||
}
|
||||
|
||||
$tests[basename($file)] = array(str_replace($fixturesDir.'/', '', $file), $message, $expect, $root, $request, $packages, $fixed);
|
||||
$tests[basename($file)] = array(str_replace($fixturesDir.'/', '', $file), $message, $expect, $root, $request, $packageRepos, $fixed);
|
||||
}
|
||||
|
||||
return $tests;
|
||||
|
@ -178,7 +180,7 @@ class PoolBuilderTest extends TestCase
|
|||
'ROOT' => false,
|
||||
'REQUEST' => true,
|
||||
'FIXED' => false,
|
||||
'PACKAGES' => true,
|
||||
'PACKAGE-REPOS' => true,
|
||||
'EXPECT' => true,
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue