ArtifactRepositoryTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Repository;
  12. use Composer\Test\TestCase;
  13. use Composer\IO\NullIO;
  14. use Composer\Config;
  15. use Composer\Package\Package;
  16. class ArtifactRepositoryTest extends TestCase
  17. {
  18. public function testExtractsConfigsFromZipArchives() {
  19. $expectedPackages = array(
  20. 'vendor0/package0-0.0.1',
  21. 'vendor1/package2-4.3.2',
  22. );
  23. $coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts');
  24. $repo = new ArtifactRepository($coordinates, new NullIO(), new Config());
  25. $foundPackages = array_map(function(Package $package) {
  26. return "{$package->getPrettyName()}-{$package->getPrettyVersion()}";
  27. }, $repo->getPackages());
  28. $this->assertEquals($expectedPackages, $foundPackages);
  29. }
  30. }