Add/fix tests
parent
2d49090ffd
commit
595182aec0
|
@ -87,6 +87,7 @@ class VersionParser
|
|||
return $version;
|
||||
}
|
||||
|
||||
// match dev branches
|
||||
if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) {
|
||||
try {
|
||||
return $this->normalizeBranch($match[1]);
|
||||
|
|
|
@ -51,6 +51,7 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
|
|||
'parses dt+patch' => array('20100102-203040-p1', '20100102-203040-patch1'),
|
||||
'parses master' => array('dev-master', '9999999-dev'),
|
||||
'parses trunk' => array('dev-trunk', '9999999-dev'),
|
||||
'parses branches' => array('1.x-dev', '1.9999999.9999999.9999999-dev'),
|
||||
'parses arbitrary' => array('dev-feature-foo', 'dev-feature-foo'),
|
||||
'parses arbitrary2' => array('DEV-FOOBAR', 'dev-foobar'),
|
||||
'ignores aliases' => array('dev-master as 1.0.0', '1.0.0.0'),
|
||||
|
|
|
@ -87,7 +87,7 @@ class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
$process->execute('git branch 1.0', $null);
|
||||
|
||||
// add 1.0.x branch
|
||||
$process->execute('git branch 1.0.x', $null);
|
||||
$process->execute('git branch 1.1.x', $null);
|
||||
|
||||
// update master to 2.0
|
||||
$composer['version'] = '2.0.0';
|
||||
|
@ -116,8 +116,8 @@ class VcsRepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
$expected = array(
|
||||
'0.6.0' => true,
|
||||
'1.0.0' => true,
|
||||
'1.0-dev' => true,
|
||||
'1.0.x-dev' => true,
|
||||
'1.1.x-dev' => true,
|
||||
'dev-feature-b' => true,
|
||||
'dev-feature-a' => true,
|
||||
'dev-master' => true,
|
||||
|
|
Loading…
Reference in New Issue