private function mockComposer(PackageInterface $package)
{
$config = $this->getMock('Composer\\Config');
$downloadManager = $this->getMock('Composer\\Downloader\\DownloadManager', [], [], '', false);
$composer = $this->getMock('Composer\\Composer', ['getConfig', 'getDownloadManager', 'getPackage']);
$composer->expects($this->any())->method('getConfig')->willReturn($config);
$composer->expects($this->any())->method('getDownloadManager')->willReturn($downloadManager);
$composer->expects($this->any())->method('getPackage')->willReturn($package);
return $composer;
}