public function test_it_keep_version_formats() { $this->SUT = new Version('v1.0.0.0', 'v1.0.0', 'v1.0.0'); $this->assertSame('v1.0.0.0', $this->SUT->getName()); $this->assertSame('v1.0.0', $this->SUT->getPretty()); $this->assertSame('v1.0.0', $this->SUT->getFullPretty()); $this->SUT = new Version('v.1.0.9999999.9999999-dev', 'dev-master', 'dev-master 1234abc'); $this->assertSame('v.1.0.9999999.9999999-dev', $this->SUT->getName()); $this->assertSame('dev-master', $this->SUT->getPretty()); $this->assertSame('dev-master 1234abc', $this->SUT->getFullPretty()); }
/** * Get the version to use for the compare url. * * For dev versions, it returns the commit short hash in full pretty version. * * @param Version $version * * @return string */ protected function getCompareVersion(Version $version) { if ($version->isDev()) { return substr($version->getFullPretty(), strlen($version->getPretty()) + 1); } return $version->getPretty(); }