mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Do not install root package as a vendor if some dependency requires it, closes #480
Also add some tests for the installer.
This commit is contained in:
parent
762f469cd9
commit
0995933183
7 changed files with 245 additions and 19 deletions
|
@ -19,26 +19,19 @@ use Composer\Util\Filesystem;
|
|||
|
||||
abstract class TestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private static $versionParser;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
if (!self::$versionParser) {
|
||||
self::$versionParser = new VersionParser();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getVersionConstraint($operator, $version)
|
||||
{
|
||||
$versionParser = new VersionParser();
|
||||
return new VersionConstraint(
|
||||
$operator,
|
||||
self::$versionParser->normalize($version)
|
||||
$versionParser->normalize($version)
|
||||
);
|
||||
}
|
||||
|
||||
protected function getPackage($name, $version)
|
||||
{
|
||||
$normVersion = self::$versionParser->normalize($version);
|
||||
$versionParser = new VersionParser();
|
||||
$normVersion = $versionParser->normalize($version);
|
||||
return new MemoryPackage($name, $normVersion, $version);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue