mirror of
https://github.com/composer/composer
synced 2025-05-09 16:42:57 +00:00
Fix 'composer show --platform <package>' erroring if no composer.json is present (#11533)
Sort of related to #11046 (although this is not a regression, but didn't work before, either)
This commit is contained in:
parent
9eb9e0dcb3
commit
07f706e57d
2 changed files with 9 additions and 2 deletions
|
@ -288,12 +288,19 @@ vendor/package 1.1.0 <highlight>! 1.2.0</highlight>", trim($appTester->getDispla
|
|||
unlink('./composer.json');
|
||||
unlink('./auth.json');
|
||||
|
||||
// listing packages
|
||||
$appTester = $this->getApplicationTester();
|
||||
$appTester->run(['command' => 'show', '-p' => true]);
|
||||
$output = trim($appTester->getDisplay(true));
|
||||
foreach (Regex::matchAll('{^(\w+)}m', $output)->matches as $m) {
|
||||
self::assertTrue(PlatformRepository::isPlatformPackage((string) $m[1]));
|
||||
}
|
||||
|
||||
// getting a single package
|
||||
$appTester->run(['command' => 'show', '-p' => true, 'package' => 'php']);
|
||||
$appTester->assertCommandIsSuccessful();
|
||||
$appTester->run(['command' => 'show', '-p' => true, '-f' => 'json', 'package' => 'php']);
|
||||
$appTester->assertCommandIsSuccessful();
|
||||
}
|
||||
|
||||
public function testOutdatedWithZeroMajor(): void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue