|
|
|
@ -67,7 +67,7 @@ class PathRepositoryTest extends TestCase
|
|
|
|
|
$this->assertNotEmpty($packageVersion);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testLoadPackageFromFileSystemWithExtraBranchVersion()
|
|
|
|
|
public function testLoadPackageFromFileSystemWithWildcard()
|
|
|
|
|
{
|
|
|
|
|
$ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')
|
|
|
|
|
->getMock();
|
|
|
|
@ -75,16 +75,24 @@ class PathRepositoryTest extends TestCase
|
|
|
|
|
$config = new \Composer\Config();
|
|
|
|
|
$versionGuesser = null;
|
|
|
|
|
|
|
|
|
|
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'with-branch-version'));
|
|
|
|
|
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', '*'));
|
|
|
|
|
$repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config);
|
|
|
|
|
$packages = $repository->getPackages();
|
|
|
|
|
$names = array();
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(2, $repository->count());
|
|
|
|
|
|
|
|
|
|
$package = $packages[0];
|
|
|
|
|
$names[] = $package->getName();
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(1, $repository->count());
|
|
|
|
|
$package = $packages[1];
|
|
|
|
|
$names[] = $package->getName();
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($repository->hasPackage($this->getPackage('test/path-branch-versioned', '1.2.x-dev')));
|
|
|
|
|
sort($names);
|
|
|
|
|
$this->assertEquals(array('test/path-unversioned', 'test/path-versioned'), $names);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testLoadPackageFromFileSystemWithWildcard()
|
|
|
|
|
public function testLoadPackageWithExplicitVersions()
|
|
|
|
|
{
|
|
|
|
|
$ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')
|
|
|
|
|
->getMock();
|
|
|
|
@ -92,19 +100,28 @@ class PathRepositoryTest extends TestCase
|
|
|
|
|
$config = new \Composer\Config();
|
|
|
|
|
$versionGuesser = null;
|
|
|
|
|
|
|
|
|
|
$options = array(
|
|
|
|
|
'versions' => array(
|
|
|
|
|
'test/path-unversioned' => '4.3.2.1',
|
|
|
|
|
'test/path-versioned' => '3.2.1.0',
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', '*'));
|
|
|
|
|
$repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config);
|
|
|
|
|
$repository = new PathRepository(array('url' => $repositoryUrl, 'options' => $options), $ioInterface, $config);
|
|
|
|
|
$packages = $repository->getPackages();
|
|
|
|
|
$result = array();
|
|
|
|
|
|
|
|
|
|
$this->assertGreaterThanOrEqual(3, $repository->count());
|
|
|
|
|
$versions = array();
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(2, $repository->count());
|
|
|
|
|
|
|
|
|
|
$package = $packages[0];
|
|
|
|
|
$versions[$package->getName()] = $package->getVersion();
|
|
|
|
|
|
|
|
|
|
foreach ($packages as $package) {
|
|
|
|
|
$result[$package->getName()] = $package->getPrettyVersion();
|
|
|
|
|
}
|
|
|
|
|
$package = $packages[1];
|
|
|
|
|
$versions[$package->getName()] = $package->getVersion();
|
|
|
|
|
|
|
|
|
|
ksort($result);
|
|
|
|
|
$this->assertSame(array('test/path-branch-versioned' => '1.2.x-dev', 'test/path-unversioned' => $result['test/path-unversioned'], 'test/path-versioned' => '0.0.2'), $result);
|
|
|
|
|
ksort($versions);
|
|
|
|
|
$this->assertSame(array('test/path-unversioned' => '4.3.2.1', 'test/path-versioned' => '3.2.1.0'), $versions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|