1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Move VersionParser::formatVersion() to BasePackage::getFullPrettyVersion()

Working towards #3545.

formatVersion() does not belong in VersionParser since it depends upon a
Package object, and is creating a more complete pretty formatted
version, not parsing anything.

The new getFullPrettyVersion() method can be seen as an extension to
getPrettyVersion(), and is located in BasePackage as a result.

Callers to VersionParser::formatVersion() were not updated in this
commit to demonstrate that no functionality was changed in this
refactor. They will be updated in a follow up commit.
This commit is contained in:
Kunal Mehta 2015-05-30 23:24:20 -07:00
parent 8775c94895
commit 99dab8aebd
4 changed files with 29 additions and 11 deletions

View file

@ -56,7 +56,7 @@ class VersionParserTest extends \PHPUnit_Framework_TestCase
$self = $this;
$createPackage = function ($arr) use ($self) {
$package = $self->getMock('\Composer\Package\PackageInterface');
$package = $self->getMockForAbstractClass('\Composer\Package\BasePackage', array(), '', false);
$package->expects($self->once())->method('isDev')->will($self->returnValue(true));
$package->expects($self->once())->method('getSourceType')->will($self->returnValue('git'));
$package->expects($self->once())->method('getPrettyVersion')->will($self->returnValue('PrettyVersion'));