1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Add support for TAR in Artifact packages (#9105)

This commit is contained in:
Wissem Riahi 2020-08-12 20:30:58 +02:00 committed by GitHub
parent ff757e649c
commit 657ae5519e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 166 additions and 4 deletions

View file

@ -36,6 +36,7 @@ class ArtifactRepositoryTest extends TestCase
'vendor1/package2-4.3.2',
'vendor3/package1-5.4.3',
'test/jsonInRoot-1.0.0',
'test/jsonInRootTarFile-1.0.0',
'test/jsonInFirstLevel-1.0.0',
//The files not-an-artifact.zip and jsonSecondLevel are not valid
//artifacts and do not get detected.
@ -52,6 +53,13 @@ class ArtifactRepositoryTest extends TestCase
sort($foundPackages);
$this->assertSame($expectedPackages, $foundPackages);
$tarPackage = array_filter($repo->getPackages(), function (BasePackage $package) {
return $package->getPrettyName() === 'test/jsonInRootTarFile';
});
$this->assertCount(1, $tarPackage);
$tarPackage = array_pop($tarPackage);
$this->assertSame('tar', $tarPackage->getDistType());
}
public function testAbsoluteRepoUrlCreatesAbsoluteUrlPackages()