/**
     * @dataProvider getMockDriversWithVersions
     */
    public function testWithFilterTags($type, $url, $class, $verbose)
    {
        $validPackageName = substr($type, 0, strpos($type, '-')) . '-asset/registry-foobar';
        $validTraces = array('');
        if ($verbose) {
            $validTraces = array();
        }

        $filter = $this->getMockBuilder('Fxp\Composer\AssetPlugin\Repository\VcsPackageFilter')
            ->disableOriginalConstructor()
            ->getMock();

        $filter->expects($this->any())
            ->method('skip')
            ->will($this->returnValue(true));

        /* @var VcsPackageFilter $filter */
        $this->init(true, $type, $url, $class, $verbose, null, 'registry-foobar', $filter);

        /* @var PackageInterface[] $packages */
        $packages = $this->repository->getPackages();
        $this->assertCount(3, $packages);

        foreach ($packages as $package) {
            if ($package instanceof AliasPackage) {
                $package =  $package->getAliasOf();
            }

            $this->assertInstanceOf('Composer\Package\CompletePackage', $package);
            $this->assertSame($validPackageName,  $package->getName());
        }

        $this->assertSame($validTraces, $this->io->getTraces());
    }
 /**
  * @dataProvider getMockDrivers
  */
 public function testPackageWithRegistryVersions($type, $url, $class)
 {
     $registryPackages = array(new CompletePackage('package1', '0.1.0.0', '0.1'), new CompletePackage('package1', '0.2.0.0', '0.2'), new CompletePackage('package1', '0.3.0.0', '0.3'), new CompletePackage('package1', '0.4.0.0', '0.4'), new CompletePackage('package1', '0.5.0.0', '0.5'), new CompletePackage('package1', '0.6.0.0', '0.6'), new CompletePackage('package1', '0.7.0.0', '0.7'), new CompletePackage('package1', '0.8.0.0', '0.8'), new CompletePackage('package1', '0.9.0.0', '0.9'), new CompletePackage('package1', '1.0.0.0', '1.0'));
     $this->init(true, $type, $url, $class, false, null, 'registry-foobar', null, $registryPackages);
     /* @var PackageInterface[] $packages */
     $packages = $this->repository->getPackages();
     $this->assertCount(10, $packages);
     $this->assertSame($registryPackages, $packages);
 }
 /**
  * @param AssetVcsRepository $repository
  * @return array
  */
 public function prepareReleases($repository)
 {
     $releases = [];
     foreach ($repository->getPackages() as $package) {
         $version = $package->getVersion();
         $require = $this->prepareRequire($package->getRequires());
         $release = ['uid' => $this->prepareUid($version), 'name' => $this->getNormalName(), 'version' => $version];
         if ($require) {
             $release['require'] = $require;
         }
         if ($package->getDistUrl()) {
             $release['dist'] = ['type' => $package->getDistType(), 'url' => $package->getDistUrl(), 'reference' => $package->getDistReference()];
         }
         if ($package->getSourceUrl()) {
             $release['source'] = ['type' => $package->getSourceType(), 'url' => $package->getSourceUrl(), 'reference' => $package->getSourceReference()];
         }
         if (isset($release['dist']) && $release['dist'] || isset($release['source']) && $release['source']) {
             $releases[$version] = $release;
         }
     }
     return $releases;
 }