1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

ArrayLoader: handle links where target is invalid numeric package name (#10663)

This commit is contained in:
Stephan 2022-03-29 11:46:51 +01:00 committed by GitHub
parent 9f8ee0e40a
commit 854aab5f03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -315,6 +315,13 @@ class ArrayLoaderTest extends TestCase
$this->assertSame('6.6.6', $links['composer-plugin-api']->getConstraint()->getPrettyString());
}
public function testParseLinksIntegerTarget(): void
{
$links = $this->loader->parseLinks('Plugin', '9.9.9', Link::TYPE_REQUIRE, array('1' => 'dev-main'));
$this->assertArrayHasKey('1', $links);
}
public function testNoneStringVersion(): void
{
$config = array(