mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Ignore references when parsing dev versions
This commit is contained in:
parent
ba29b4bf94
commit
c10eb66ac4
2 changed files with 22 additions and 0 deletions
|
@ -112,6 +112,21 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertSame((string) new VersionConstraint('=', '1.0.0.0'), (string) $parser->parseConstraints('1.0@dev'));
|
||||
}
|
||||
|
||||
public function testParseConstraintsIgnoresReferenceOnDevVersion()
|
||||
{
|
||||
$parser = new VersionParser;
|
||||
$this->assertSame((string) new VersionConstraint('=', '1.0.9999999.9999999-dev'), (string) $parser->parseConstraints('1.0.x-dev#abcd123'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException UnexpectedValueException
|
||||
*/
|
||||
public function testParseConstraintsFailsOnBadReference()
|
||||
{
|
||||
$parser = new VersionParser;
|
||||
$this->assertSame((string) new VersionConstraint('=', '1.0.0.0'), (string) $parser->parseConstraints('1.0#abcd123'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider simpleConstraints
|
||||
*/
|
||||
|
@ -213,6 +228,7 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
|
|||
return array(
|
||||
array('stable', '1.0'),
|
||||
array('dev', 'v2.0.x-dev'),
|
||||
array('dev', 'v2.0.x-dev#abc123'),
|
||||
array('RC', '3.0-RC2'),
|
||||
array('dev', 'dev-master'),
|
||||
array('dev', '3.1.2-dev'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue