* Jordi Boggiano * * 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; use PHPUnit\Framework\TestCase; class VersionParserTest extends 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'))), ); } }