Revert "Do not dump source and dist for metapackages"
The source/dist reference is needed to operate composer outdated and other functionality
Fixes #7546
This reverts commit 42739e7959
.
pull/7579/head
parent
7d273f7cd8
commit
3d01ef28fa
|
@ -45,7 +45,7 @@ class ArrayDumper
|
||||||
$data['target-dir'] = $package->getTargetDir();
|
$data['target-dir'] = $package->getTargetDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($package->getSourceType() && $package->getType() !== 'metapackage') {
|
if ($package->getSourceType()) {
|
||||||
$data['source']['type'] = $package->getSourceType();
|
$data['source']['type'] = $package->getSourceType();
|
||||||
$data['source']['url'] = $package->getSourceUrl();
|
$data['source']['url'] = $package->getSourceUrl();
|
||||||
$data['source']['reference'] = $package->getSourceReference();
|
$data['source']['reference'] = $package->getSourceReference();
|
||||||
|
@ -54,7 +54,7 @@ class ArrayDumper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($package->getDistType() && $package->getType() !== 'metapackage') {
|
if ($package->getDistType()) {
|
||||||
$data['dist']['type'] = $package->getDistType();
|
$data['dist']['type'] = $package->getDistType();
|
||||||
$data['dist']['url'] = $package->getDistUrl();
|
$data['dist']['url'] = $package->getDistUrl();
|
||||||
$data['dist']['reference'] = $package->getDistReference();
|
$data['dist']['reference'] = $package->getDistReference();
|
||||||
|
|
|
@ -106,57 +106,6 @@ class ArrayDumperTest extends TestCase
|
||||||
$this->assertSame($expectedValue ?: $value, $config[$key]);
|
$this->assertSame($expectedValue ?: $value, $config[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMetapackageShouldNotHaveSourceEntries()
|
|
||||||
{
|
|
||||||
$this
|
|
||||||
->packageExpects('getPrettyName', 'foo')
|
|
||||||
->packageExpects('getPrettyVersion', '1.0')
|
|
||||||
->packageExpects('getVersion', '1.0.0.0')
|
|
||||||
->packageExpects('getType', 'metapackage')
|
|
||||||
->packageExpects('getSourceType', 'composer')
|
|
||||||
->packageExpects('getSourceUrl', 'https://packagist.org')
|
|
||||||
->packageExpects('getSourceReference', 'packagist')
|
|
||||||
;
|
|
||||||
|
|
||||||
$config = $this->dumper->dump($this->package);
|
|
||||||
|
|
||||||
$this->assertEquals(
|
|
||||||
array(
|
|
||||||
'name' => 'foo',
|
|
||||||
'version' => '1.0',
|
|
||||||
'version_normalized' => '1.0.0.0',
|
|
||||||
'type' => 'metapackage',
|
|
||||||
),
|
|
||||||
$config
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testMetapackageShouldNotHaveDistEntries()
|
|
||||||
{
|
|
||||||
$this
|
|
||||||
->packageExpects('getPrettyName', 'foo')
|
|
||||||
->packageExpects('getPrettyVersion', '1.0')
|
|
||||||
->packageExpects('getVersion', '1.0.0.0')
|
|
||||||
->packageExpects('getType', 'metapackage')
|
|
||||||
->packageExpects('getDistType', 'composer')
|
|
||||||
->packageExpects('getDistUrl', 'https://packagist.org')
|
|
||||||
->packageExpects('getDistReference', 'packagist')
|
|
||||||
->packageExpects('getDistSha1Checksum', 'packagist')
|
|
||||||
;
|
|
||||||
|
|
||||||
$config = $this->dumper->dump($this->package);
|
|
||||||
|
|
||||||
$this->assertEquals(
|
|
||||||
array(
|
|
||||||
'name' => 'foo',
|
|
||||||
'version' => '1.0',
|
|
||||||
'version_normalized' => '1.0.0.0',
|
|
||||||
'type' => 'metapackage',
|
|
||||||
),
|
|
||||||
$config
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getKeys()
|
public function getKeys()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
|
Loading…
Reference in New Issue