|
@@ -106,6 +106,57 @@ class ArrayDumperTest extends TestCase
|
|
|
$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()
|
|
|
{
|
|
|
return array(
|