Skip to content

Commit

Permalink
Fix handling for double-zero prefix, refs composer#11032
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored and emahorvat52 committed Jan 18, 2023
1 parent 8ad6bc0 commit e40d2fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/Composer/Test/Command/ShowCommandTest.php
Expand Up @@ -199,6 +199,8 @@ public function testOutdatedWithZeroMajor(): void
'packages' => [
'type' => 'package',
'package' => [
['name' => 'zerozero/major', 'description' => 'generic description', 'version' => '0.0.1'],
['name' => 'zerozero/major', 'description' => 'generic description', 'version' => '0.0.2'],
['name' => 'zero/major', 'description' => 'generic description', 'version' => '0.1.0'],
['name' => 'zero/major', 'description' => 'generic description', 'version' => '0.2.0'],
['name' => 'zero/minor', 'description' => 'generic description', 'version' => '0.1.0'],
Expand All @@ -209,13 +211,15 @@ public function testOutdatedWithZeroMajor(): void
],
],
'require' => [
'zerozero/major' => '^0.0.1',
'zero/major' => '^0.1',
'zero/minor' => '^0.1',
'zero/patch' => '^0.1',
],
]);

$this->createInstalledJson([
$this->getPackage('zerozero/major', '0.0.1'),
$this->getPackage('zero/major', '0.1.0'),
$this->getPackage('zero/minor', '0.1.0'),
$this->getPackage('zero/patch', '0.1.2'),
Expand Down Expand Up @@ -244,7 +248,8 @@ public function testOutdatedWithZeroMajor(): void
'Legend:
! patch or minor release available - update recommended
~ major release available - update possible
zero/major 0.1.0 ~ 0.2.0', trim($appTester->getDisplay(true)));
zero/major 0.1.0 ~ 0.2.0
zerozero/major 0.0.1 ~ 0.0.2', trim($appTester->getDisplay(true)));
}

public function testShowAllShowsAllSections(): void
Expand Down

0 comments on commit e40d2fb

Please sign in to comment.