2013-03-24 19:27:50 +00:00
|
|
|
<?php
|
2013-03-24 23:41:10 +00:00
|
|
|
|
2013-03-24 19:27:50 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
|
|
|
* Jordi Boggiano <j.boggiano@seld.be>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Composer\Repository;
|
|
|
|
|
2013-09-25 08:14:42 +00:00
|
|
|
use Composer\TestCase;
|
2013-03-24 19:27:50 +00:00
|
|
|
use Composer\IO\NullIO;
|
|
|
|
use Composer\Config;
|
2013-03-31 19:44:48 +00:00
|
|
|
use Composer\Package\BasePackage;
|
2013-03-24 19:27:50 +00:00
|
|
|
|
|
|
|
class ArtifactRepositoryTest extends TestCase
|
|
|
|
{
|
2013-03-24 23:41:10 +00:00
|
|
|
public function testExtractsConfigsFromZipArchives()
|
|
|
|
{
|
2013-03-24 19:27:50 +00:00
|
|
|
$expectedPackages = array(
|
2013-03-31 20:01:55 +00:00
|
|
|
'vendor0/package0-0.0.1',
|
2013-03-31 19:53:34 +00:00
|
|
|
'composer/composer-1.0.0-alpha6',
|
2013-03-24 19:27:50 +00:00
|
|
|
'vendor1/package2-4.3.2',
|
2013-06-13 14:20:52 +00:00
|
|
|
'vendor3/package1-5.4.3',
|
2013-03-24 19:27:50 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts');
|
|
|
|
$repo = new ArtifactRepository($coordinates, new NullIO(), new Config());
|
|
|
|
|
2013-03-31 19:44:48 +00:00
|
|
|
$foundPackages = array_map(function(BasePackage $package) {
|
2013-03-24 19:27:50 +00:00
|
|
|
return "{$package->getPrettyName()}-{$package->getPrettyVersion()}";
|
|
|
|
}, $repo->getPackages());
|
|
|
|
|
2013-03-31 20:01:55 +00:00
|
|
|
sort($expectedPackages);
|
|
|
|
sort($foundPackages);
|
|
|
|
|
|
|
|
$this->assertSame($expectedPackages, $foundPackages);
|
2013-03-24 19:27:50 +00:00
|
|
|
}
|
|
|
|
}
|