1
0
Fork 0

set version to dev-master to artifacts without version

pull/1728/head
Serge Smertin 2013-03-31 21:44:48 +02:00
parent d45844fb63
commit b5e1457470
3 changed files with 8 additions and 2 deletions

View File

@ -94,6 +94,10 @@ class ArtifactRepository extends ArrayRepository
'shasum' => sha1_file($file->getRealPath())
);
if(empty($package['version'])) {
$package['version'] = 'dev-master';
}
$package = $this->loader->load($package);
return $package;

View File

@ -15,13 +15,15 @@ namespace Composer\Repository;
use Composer\Test\TestCase;
use Composer\IO\NullIO;
use Composer\Config;
use Composer\Package\Package;
use Composer\Package\BasePackage;
class ArtifactRepositoryTest extends TestCase
{
public function testExtractsConfigsFromZipArchives()
{
$expectedPackages = array(
'composer/composer-dev-master',
'composer/composer-1.0.x-dev',
'composer/composer-1.0.0-alpha6',
'vendor0/package0-0.0.1',
'vendor1/package2-4.3.2',
@ -30,7 +32,7 @@ class ArtifactRepositoryTest extends TestCase
$coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts');
$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()}";
}, $repo->getPackages());