set version to dev-master to artifacts without version
parent
d45844fb63
commit
b5e1457470
|
@ -94,6 +94,10 @@ class ArtifactRepository extends ArrayRepository
|
||||||
'shasum' => sha1_file($file->getRealPath())
|
'shasum' => sha1_file($file->getRealPath())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(empty($package['version'])) {
|
||||||
|
$package['version'] = 'dev-master';
|
||||||
|
}
|
||||||
|
|
||||||
$package = $this->loader->load($package);
|
$package = $this->loader->load($package);
|
||||||
|
|
||||||
return $package;
|
return $package;
|
||||||
|
|
|
@ -15,13 +15,15 @@ namespace Composer\Repository;
|
||||||
use Composer\Test\TestCase;
|
use Composer\Test\TestCase;
|
||||||
use Composer\IO\NullIO;
|
use Composer\IO\NullIO;
|
||||||
use Composer\Config;
|
use Composer\Config;
|
||||||
use Composer\Package\Package;
|
use Composer\Package\BasePackage;
|
||||||
|
|
||||||
class ArtifactRepositoryTest extends TestCase
|
class ArtifactRepositoryTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testExtractsConfigsFromZipArchives()
|
public function testExtractsConfigsFromZipArchives()
|
||||||
{
|
{
|
||||||
$expectedPackages = array(
|
$expectedPackages = array(
|
||||||
|
'composer/composer-dev-master',
|
||||||
|
'composer/composer-1.0.x-dev',
|
||||||
'composer/composer-1.0.0-alpha6',
|
'composer/composer-1.0.0-alpha6',
|
||||||
'vendor0/package0-0.0.1',
|
'vendor0/package0-0.0.1',
|
||||||
'vendor1/package2-4.3.2',
|
'vendor1/package2-4.3.2',
|
||||||
|
@ -30,7 +32,7 @@ class ArtifactRepositoryTest extends TestCase
|
||||||
$coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts');
|
$coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts');
|
||||||
$repo = new ArtifactRepository($coordinates, new NullIO(), new Config());
|
$repo = new ArtifactRepository($coordinates, new NullIO(), new Config());
|
||||||
|
|
||||||
$foundPackages = array_map(function(Package $package) {
|
$foundPackages = array_map(function(BasePackage $package) {
|
||||||
return "{$package->getPrettyName()}-{$package->getPrettyVersion()}";
|
return "{$package->getPrettyName()}-{$package->getPrettyVersion()}";
|
||||||
}, $repo->getPackages());
|
}, $repo->getPackages());
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue