1
0
Fork 0

Merge remote-tracking branch 'origin/1.6'

pull/7483/head
Jordi Boggiano 2018-07-20 11:39:44 +02:00
commit 16af52be8a
3 changed files with 17 additions and 2 deletions

View File

@ -115,10 +115,10 @@ class SuggestedPackagesReporter
}
$this->io->writeError(sprintf(
'%s suggests installing %s (%s)',
'%s suggests installing %s%s',
$suggestion['source'],
$this->escapeOutput($suggestion['target']),
$this->escapeOutput($suggestion['reason'])
$this->escapeOutput('' !== $suggestion['reason'] ? ' ('.$suggestion['reason'].')' : '')
));
}

View File

@ -138,6 +138,7 @@ class ArtifactRepository extends ArrayRepository implements ConfigurableReposito
}
$configurationFileName = $zip->getNameIndex($foundFileIndex);
$zip->close();
$composerFile = "zip://{$file->getPathname()}#$configurationFileName";
$json = file_get_contents($composerFile);

View File

@ -142,6 +142,20 @@ class SuggestedPackagesReporterTest extends TestCase
$this->suggestedPackagesReporter->output();
}
/**
* @covers ::output
*/
public function testOutputWithNoSuggestedPackage()
{
$this->suggestedPackagesReporter->addPackage('a', 'b', '');
$this->io->expects($this->once())
->method('writeError')
->with('a suggests installing b');
$this->suggestedPackagesReporter->output();
}
/**
* @covers ::output
*/