mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Merge remote-tracking branch 'nfx/artefact-repo-type'
This commit is contained in:
commit
e50173ff93
8 changed files with 186 additions and 0 deletions
42
tests/Composer/Test/Repository/ArtifactRepositoryTest.php
Normal file
42
tests/Composer/Test/Repository/ArtifactRepositoryTest.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
use Composer\Test\TestCase;
|
||||
use Composer\IO\NullIO;
|
||||
use Composer\Config;
|
||||
use Composer\Package\BasePackage;
|
||||
|
||||
class ArtifactRepositoryTest extends TestCase
|
||||
{
|
||||
public function testExtractsConfigsFromZipArchives()
|
||||
{
|
||||
$expectedPackages = array(
|
||||
'vendor0/package0-0.0.1',
|
||||
'composer/composer-1.0.0-alpha6',
|
||||
'vendor1/package2-4.3.2',
|
||||
);
|
||||
|
||||
$coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts');
|
||||
$repo = new ArtifactRepository($coordinates, new NullIO(), new Config());
|
||||
|
||||
$foundPackages = array_map(function(BasePackage $package) {
|
||||
return "{$package->getPrettyName()}-{$package->getPrettyVersion()}";
|
||||
}, $repo->getPackages());
|
||||
|
||||
sort($expectedPackages);
|
||||
sort($foundPackages);
|
||||
|
||||
$this->assertSame($expectedPackages, $foundPackages);
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
BIN
tests/Composer/Test/Repository/Fixtures/artifacts/package0.zip
Normal file
BIN
tests/Composer/Test/Repository/Fixtures/artifacts/package0.zip
Normal file
Binary file not shown.
BIN
tests/Composer/Test/Repository/Fixtures/artifacts/package2.zip
Normal file
BIN
tests/Composer/Test/Repository/Fixtures/artifacts/package2.zip
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue