|
|
@ -69,6 +69,23 @@ class PathRepositoryTest extends TestCase
|
|
|
|
$this->assertNotEmpty($packageVersion);
|
|
|
|
$this->assertNotEmpty($packageVersion);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function testLoadPackageFromFileSystemWithExtraBranchVersion()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')
|
|
|
|
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$config = new \Composer\Config();
|
|
|
|
|
|
|
|
$versionGuesser = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'with-branch-version'));
|
|
|
|
|
|
|
|
$repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config);
|
|
|
|
|
|
|
|
$packages = $repository->getPackages();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(1, $repository->count());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertTrue($repository->hasPackage($this->getPackage('test/path-branch-versioned', '1.2.x-dev')));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testLoadPackageFromFileSystemWithWildcard()
|
|
|
|
public function testLoadPackageFromFileSystemWithWildcard()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')
|
|
|
|
$ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')
|
|
|
@ -82,7 +99,7 @@ class PathRepositoryTest extends TestCase
|
|
|
|
$packages = $repository->getPackages();
|
|
|
|
$packages = $repository->getPackages();
|
|
|
|
$names = array();
|
|
|
|
$names = array();
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertGreaterThanOrEqual(2, $repository->count());
|
|
|
|
$this->assertGreaterThanOrEqual(3, $repository->count());
|
|
|
|
|
|
|
|
|
|
|
|
$package = $packages[0];
|
|
|
|
$package = $packages[0];
|
|
|
|
$names[] = $package->getName();
|
|
|
|
$names[] = $package->getName();
|
|
|
@ -90,8 +107,11 @@ class PathRepositoryTest extends TestCase
|
|
|
|
$package = $packages[count($packages) - 1];
|
|
|
|
$package = $packages[count($packages) - 1];
|
|
|
|
$names[] = $package->getName();
|
|
|
|
$names[] = $package->getName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$package = $packages[2];
|
|
|
|
|
|
|
|
$names[] = $package->getName();
|
|
|
|
|
|
|
|
|
|
|
|
sort($names);
|
|
|
|
sort($names);
|
|
|
|
$this->assertSame(array('test/path-unversioned', 'test/path-versioned'), $names);
|
|
|
|
$this->assertSame(array('test/path-branch-versioned', 'test/path-unversioned', 'test/path-versioned'), $names);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|