diff --git a/src/Composer/Package/BasePackage.php b/src/Composer/Package/BasePackage.php index 7ffea71e5..ec05fa7be 100644 --- a/src/Composer/Package/BasePackage.php +++ b/src/Composer/Package/BasePackage.php @@ -120,7 +120,7 @@ abstract class BasePackage implements PackageInterface */ public function __toString() { - return $this->getName().'-'.$this->getReleaseType().'-'.$this->getVersion(); + return $this->getName().'-'.$this->getVersion().'-'.$this->getReleaseType(); } /** diff --git a/tests/Composer/Test/Package/MemoryPackageTest.php b/tests/Composer/Test/Package/MemoryPackageTest.php index 7f8cc269e..7176b8e4a 100644 --- a/tests/Composer/Test/Package/MemoryPackageTest.php +++ b/tests/Composer/Test/Package/MemoryPackageTest.php @@ -24,6 +24,6 @@ class MemoryPackageTest extends \PHPUnit_Framework_TestCase $this->assertEquals('1', $package->getVersion()); $this->assertEquals('beta', $package->getReleaseType()); - $this->assertEquals('foo-beta-1', (string) $package); + $this->assertEquals('foo-1-beta', (string) $package); } }