Hide suggest reason when there is not one
parent
5bae1913ab
commit
87646ae689
|
@ -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'].')' : '')
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue