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

ArrayLoader/ValidatingArrayLoader: handle non-string values for version/version_normalized (#10470)

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
This commit is contained in:
Stephan 2022-01-21 13:57:28 +00:00 committed by GitHub
parent 6b8f1409e4
commit 3b4afaa9e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 7 deletions

View file

@ -314,4 +314,15 @@ class ArrayLoaderTest extends TestCase
$this->assertArrayHasKey('composer-plugin-api', $links);
$this->assertSame('6.6.6', $links['composer-plugin-api']->getConstraint()->getPrettyString());
}
public function testNoneStringVersion()
{
$config = array(
'name' => 'acme/package',
'version' => 1,
);
$package = $this->loader->load($config);
$this->assertSame('1', $package->getPrettyVersion());
}
}