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

ArrayLoader: assert that source/dist reference are string values (#10647)

This commit is contained in:
Stephan 2022-03-22 08:48:51 +00:00 committed by GitHub
parent 166542f981
commit 61be158040
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View file

@ -325,4 +325,26 @@ class ArrayLoaderTest extends TestCase
$package = $this->loader->load($config);
$this->assertSame('1', $package->getPrettyVersion());
}
public function testNoneStringSourceDistReference(): void
{
$config = array(
'name' => 'acme/package',
'version' => 'dev-main',
'source' => [
'type' => 'svn',
'url' => 'https://example.org/',
'reference' => 2019,
],
'dist' => [
'type' => 'zip',
'url' => 'https://example.org/',
'reference' => 2019,
],
);
$package = $this->loader->load($config);
$this->assertSame('2019', $package->getSourceReference());
$this->assertSame('2019', $package->getDistReference());
}
}