1
0
Fork 0

Add a couple version parser tests

pull/1773/head
Jordi Boggiano 2013-04-04 17:35:55 +02:00
parent bb9b6ddb4b
commit 1f79f36227
1 changed files with 3 additions and 0 deletions

View File

@ -88,6 +88,8 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
'forces w.x.y.z' => array('1.0-dev', '1.0.0.0-dev'),
'forces w.x.y.z/2' => array('0', '0.0.0.0'),
'parses long' => array('10.4.13-beta', '10.4.13.0-beta'),
'expand shorthand' => array('10.4.13-b', '10.4.13.0-beta'),
'expand shorthand2' => array('10.4.13-b5', '10.4.13.0-beta5'),
'strips leading v' => array('v1.0.0', '1.0.0.0'),
'strips v/datetime' => array('v20100102', '20100102'),
'parses dates y-m' => array('2010.01', '2010-01'),
@ -204,6 +206,7 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
'double equals' => array('==1.2.3', new VersionConstraint('=', '1.2.3.0')),
'no op means eq' => array('1.2.3', new VersionConstraint('=', '1.2.3.0')),
'completes version' => array('=1.0', new VersionConstraint('=', '1.0.0.0')),
'shorthand beta' => array('1.2.3b5', new VersionConstraint('=', '1.2.3.0-beta5')),
'accepts spaces' => array('>= 1.2.3', new VersionConstraint('>=', '1.2.3.0')),
'accepts master' => array('>=dev-master', new VersionConstraint('>=', '9999999-dev')),
'accepts master/2' => array('dev-master', new VersionConstraint('=', '9999999-dev')),