/**
     * @param string $type
     * @param bool   $verbose
     * @param string $exceptionClass
     * @param string $validTrace
     *
     * @dataProvider getConfigIoForException
     */
    public function testTagWithTransportException($type, $verbose, $exceptionClass, $validTrace)
    {
        /* @var \PHPUnit_Framework_MockObject_MockObject $loader */
        $loader = $this->loader;
        $loader
            ->expects($this->any())
            ->method('load')
            ->will($this->throwException(new $exceptionClass('MESSAGE')));

        $this->lazyLoader = $this->createLazyLoaderConfigured($type, $verbose);
        $package = $this->lazyLoader->load($this->lazyPackage);

        $this->assertFalse($package);

        $filename = $this->assetType->getFilename();
        $validOutput = array('');

        if ($verbose) {
            $validOutput = array(
                'Reading ' . $filename . ' of <info>' . $this->lazyPackage->getName() . '</info> (<comment>' . $this->lazyPackage->getPrettyVersion() . '</comment>)',
                'Importing empty ' . $type . ' ' . $this->lazyPackage->getPrettyVersion() . ' (' . $this->lazyPackage->getVersion() . ')',
                $validTrace,
                '',
            );
        }
        $this->assertSame($validOutput, $this->io->getTraces());

        $packageCache = $this->lazyLoader->load($this->lazyPackage);
        $this->assertFalse($packageCache);
        $this->assertSame($validOutput, $this->io->getTraces());
    }
    /**
     * Loads the real package.
     *
     * @param LazyPackageInterface $package
     *
     * @return CompletePackageInterface|false
     */
    protected function loadRealPackage(LazyPackageInterface $package)
    {
        $realPackage = false;

        try {
            $data = $this->driver->getComposerInformation($this->identifier);
            $valid = is_array($data);
            $data = $this->preProcess($this->driver, $this->validateData($data), $this->identifier);

            if ($this->verbose) {
                $this->io->write('Importing ' . ($valid ? '' : 'empty ') . $this->type . ' '.$data['version'].' ('.$data['version_normalized'].')');
            }

            /* @var CompletePackageInterface $realPackage */
            $realPackage = $this->loader->load($data);
        } catch (\Exception $e) {
            if ($this->verbose) {
                $filename = $this->assetType->getFilename();
                $this->io->write('<'.$this->getIoTag().'>Skipped ' . $this->type . ' '.$package->getPrettyVersion().', '.($e instanceof TransportException ? 'no ' . $filename . ' file was found' : $e->getMessage()).'</'.$this->getIoTag().'>');
            }
        }
        $this->driver->cleanup();

        return $realPackage;
    }
    /**
     * @param string $lazyType
     *
     * @dataProvider getConfigLazyLoader
     */
    public function testMissingAssetType($lazyType)
    {
        if (null !== $lazyType) {
            $lp = 'lazy' === $lazyType
                ? new CompletePackage($this->package->getName(),
                    $this->package->getVersion(), $this->package->getPrettyVersion())
                : false;

            $loader = $this->getMock('Fxp\Composer\AssetPlugin\Package\Loader\LazyLoaderInterface');
            $loader
                ->expects($this->any())
                ->method('load')
                ->will($this->returnValue($lp));

            /* @var LazyLoaderInterface$loader */
            $this->package->setLoader($loader);
        }

        $this->assertSame('library', $this->package->getType());
        $this->assertSame(array(), $this->package->getTransportOptions());
        $this->assertNull($this->package->getTargetDir());
        $this->assertSame(array(), $this->package->getExtra());
        $this->assertSame(array(), $this->package->getBinaries());
        $this->assertNull($this->package->getInstallationSource());
        $this->assertNull($this->package->getSourceType());
        $this->assertNull($this->package->getSourceUrl());
        $this->assertNull($this->package->getSourceReference());
        $this->assertNull($this->package->getSourceMirrors());
        $this->assertSame(array(), $this->package->getSourceUrls());
        $this->assertNull($this->package->getDistType());
        $this->assertNull($this->package->getDistUrl());
        $this->assertNull($this->package->getDistReference());
        $this->assertNull($this->package->getDistSha1Checksum());
        $this->assertNull($this->package->getDistMirrors());
        $this->assertSame(array(), $this->package->getDistUrls());
        $this->assertNull($this->package->getReleaseDate());
        $this->assertSame(array(), $this->package->getRequires());
        $this->assertSame(array(), $this->package->getConflicts());
        $this->assertSame(array(), $this->package->getProvides());
        $this->assertSame(array(), $this->package->getReplaces());
        $this->assertSame(array(), $this->package->getDevRequires());
        $this->assertSame(array(), $this->package->getSuggests());
        $this->assertSame(array(), $this->package->getAutoload());
        $this->assertSame(array(), $this->package->getDevAutoload());
        $this->assertSame(array(), $this->package->getIncludePaths());
        $this->assertNull($this->package->getNotificationUrl());
        $this->assertSame(array(), $this->package->getArchiveExcludes());
        $this->assertSame(array(), $this->package->getScripts());
        $this->assertNull($this->package->getRepositories());
        $this->assertSame(array(), $this->package->getLicense());
        $this->assertNull($this->package->getKeywords());
        $this->assertNull($this->package->getAuthors());
        $this->assertNull($this->package->getDescription());
        $this->assertNull($this->package->getHomepage());
        $this->assertSame(array(), $this->package->getSupport());
    }