1
0
Fork 0

Fixed upper bound of wildcard matches.

Follow-on from 95b4348afa
pull/1881/head
Sam Minnee 2013-05-20 19:10:04 +12:00
parent 95b4348afa
commit 324ef0f9bb
2 changed files with 8 additions and 8 deletions

View File

@ -324,7 +324,7 @@ class VersionParser
} }
$lowVersion = $this->manipulateVersionString($matches, $position) . "-dev"; $lowVersion = $this->manipulateVersionString($matches, $position) . "-dev";
$highVersion = $this->manipulateVersionString($matches, $position, 0, '9999999'); $highVersion = $this->manipulateVersionString($matches, $position, 1) . "-dev";
if($lowVersion === "0.0.0.0-dev") { if($lowVersion === "0.0.0.0-dev") {
return array(new VersionConstraint('<', $highVersion)); return array(new VersionConstraint('<', $highVersion));

View File

@ -237,13 +237,13 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
public function wildcardConstraints() public function wildcardConstraints()
{ {
return array( return array(
array('2.*', new VersionConstraint('>=', '2.0.0.0-dev'), new VersionConstraint('<', '2.9999999.9999999.9999999')), array('2.*', new VersionConstraint('>=', '2.0.0.0-dev'), new VersionConstraint('<', '3.0.0.0-dev')),
array('20.*', new VersionConstraint('>=', '20.0.0.0-dev'), new VersionConstraint('<', '20.9999999.9999999.9999999')), array('20.*', new VersionConstraint('>=', '20.0.0.0-dev'), new VersionConstraint('<', '21.0.0.0-dev')),
array('2.0.*', new VersionConstraint('>=', '2.0.0.0-dev'), new VersionConstraint('<', '2.0.9999999.9999999')), array('2.0.*', new VersionConstraint('>=', '2.0.0.0-dev'), new VersionConstraint('<', '2.1.0.0-dev')),
array('2.2.x', new VersionConstraint('>=', '2.2.0.0-dev'), new VersionConstraint('<', '2.2.9999999.9999999')), array('2.2.x', new VersionConstraint('>=', '2.2.0.0-dev'), new VersionConstraint('<', '2.3.0.0-dev')),
array('2.10.x', new VersionConstraint('>=', '2.10.0.0-dev'), new VersionConstraint('<', '2.10.9999999.9999999')), array('2.10.x', new VersionConstraint('>=', '2.10.0.0-dev'), new VersionConstraint('<', '2.11.0.0-dev')),
array('2.1.3.*', new VersionConstraint('>=', '2.1.3.0-dev'), new VersionConstraint('<', '2.1.3.9999999')), array('2.1.3.*', new VersionConstraint('>=', '2.1.3.0-dev'), new VersionConstraint('<', '2.1.4.0-dev')),
array('0.*', null, new VersionConstraint('<', '0.9999999.9999999.9999999')), array('0.*', null, new VersionConstraint('<', '1.0.0.0-dev')),
); );
} }