mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fix platform package detection in VersionParser
This commit is contained in:
parent
11f1e03739
commit
71c2ecbace
2 changed files with 39 additions and 1 deletions
37
tests/Composer/Test/Package/Version/VersionParserTest.php
Normal file
37
tests/Composer/Test/Package/Version/VersionParserTest.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Test\Package\Version;
|
||||
|
||||
use Composer\Package\Version\VersionParser;
|
||||
|
||||
class VersionParserTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider getParseNameVersionPairsData
|
||||
*/
|
||||
public function testParseNameVersionPairs($pairs, $result)
|
||||
{
|
||||
$versionParser = new VersionParser();
|
||||
|
||||
$this->assertSame($result, $versionParser->parseNameVersionPairs($pairs));
|
||||
}
|
||||
|
||||
public function getParseNameVersionPairsData()
|
||||
{
|
||||
return array(
|
||||
array(array('php:^7.0'), array(array('name' => 'php', 'version' => '^7.0'))),
|
||||
array(array('php', '^7.0'), array(array('name' => 'php', 'version' => '^7.0'))),
|
||||
array(array('php', 'ext-apcu'), array(array('name' => 'php'), array('name' => 'ext-apcu'))),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue