mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Add types to Package
tests (#10245)
This commit is contained in:
parent
a155c076db
commit
bcbd8fdb61
16 changed files with 159 additions and 21 deletions
|
@ -18,7 +18,10 @@ use Composer\Test\TestCase;
|
|||
class VersionParserTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getParseNameVersionPairsData
|
||||
* @dataProvider provideParseNameVersionPairsData
|
||||
*
|
||||
* @param string[] $pairs
|
||||
* @param array<array<string, string>> $result
|
||||
*/
|
||||
public function testParseNameVersionPairs($pairs, $result)
|
||||
{
|
||||
|
@ -27,7 +30,7 @@ class VersionParserTest extends TestCase
|
|||
$this->assertSame($result, $versionParser->parseNameVersionPairs($pairs));
|
||||
}
|
||||
|
||||
public function getParseNameVersionPairsData()
|
||||
public function provideParseNameVersionPairsData()
|
||||
{
|
||||
return array(
|
||||
array(array('php:^7.0'), array(array('name' => 'php', 'version' => '^7.0'))),
|
||||
|
@ -39,14 +42,18 @@ class VersionParserTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getIsUpgradeTests
|
||||
* @dataProvider provideIsUpgradeTests
|
||||
*
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @param bool $expected
|
||||
*/
|
||||
public function testIsUpgrade($from, $to, $expected)
|
||||
{
|
||||
$this->assertSame($expected, VersionParser::isUpgrade($from, $to));
|
||||
}
|
||||
|
||||
public function getIsUpgradeTests()
|
||||
public function provideIsUpgradeTests()
|
||||
{
|
||||
return array(
|
||||
array('0.9.0.0', '1.0.0.0', true),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue